I used cache() to cache the data in memory but I realized to see the performance without cached data I need to uncache it to remove data from memory:
//doing some computation
but I got the error said:
value uncache is not a member of org.apache.spark.rdd.RDD[(Int, Array[Float])]
I don't know how to do the uncache then!