A company is using Amazon EMR to run Spark jobs. The jobs are failing due to memory issues. Which THREE configurations can help mitigate out-of-memory errors?
Correct. Tuning parameters like spark.executor.memory and spark.memory.fraction controls how much JVM heap and unified memory are available for execution and storage, directly mitigating OOM errors.
Why this answer
The correct options are C, D, and E. Tuning Spark memory configurations (C) such as spark.executor.memory and spark.memory.fraction directly controls memory allocation within executors. Increasing the instance type to one with more memory per node (D) provides additional physical memory for Spark workloads.
Enabling Spark dynamic allocation (E) allows the cluster to automatically adjust the number of executors based on workload, which helps prevent memory pressure from over-allocation. Option A is incorrect because instance store volumes are used for temporary data storage (e.g., shuffle spills) but do not address memory constraints; they may help with disk I/O but not OOM errors. Option B is incorrect because increasing vCPUs increases parallelism, which can actually worsen memory contention if each task consumes significant memory, potentially leading to more OOM errors.