Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens if an RDD can't fit into memory in Spark? [duplicate]

As far as I know, Spark tries to do all computation in memory, unless you call persist with disk storage option. If however, we don't use any persist, what does Spark do when an RDD doesn't fit in memory? What if we have very huge data. How will Spark handle it without crashing?

like image 489
MetallicPriest Avatar asked Sep 15 '15 09:09

MetallicPriest


1 Answers

From Apache Spark FAQ's:

Spark's operators spill data to disk if it does not fit in memory, allowing it to run well on any sized data. Likewise, cached datasets that do not fit in memory are either spilled to disk or recomputed on the fly when needed, as determined by the RDD's storage level.

Refer below link to know more about storage levels and how to choose appropriate one between these levels: programming-guide.html

like image 107
Sachin Gaikwad Avatar answered Nov 07 '22 08:11

Sachin Gaikwad