From the Apache Spark FAQ:
Spark operators spill data onto a disk if it does not fit into memory, which allows it to work well with data of any size. Likewise, cached data sets that do not fit into memory are either poured onto the disk or redistributed on the fly if necessary, as determined by the RDD storage level.
Refer to the link below to learn more about storage tiers and how to choose the appropriate tier between these tiers: programming-guide.html
source
share