Reputation: 283
We have a Spark 2.2 job writte in Scala running in a YARN cluster that does the following:
The following configuration fails via java.lang.OutOfMemory java heap space:
However, this job works reliably if we remove spark.executor.memory entirely. This gives each executor 1g of ram.
This job also fails if we do any of the following:
Can anyone help me understand why more memory and more executors leads to failed jobs due to OutOfMemory?
Upvotes: 0
Views: 275
Reputation: 786
Manually setting these parameters disables dynamic allocation. Try leaving it alone, since it is recommended for beginners. It's also useful for experimentation before you can fine tune cluster size in a PROD setting.
Throwing more memory/executors at Spark seems like a good idea, but in your case it probably caused extra shuffles and/or decreased HDFS I/O throughput. This article, while slightly dated and geared towards Cloudera users, explains how to tune parallelism by right-sizing executors.
Upvotes: 0