| region | size | what lives there |
|---|---|---|
| Reserved | 300 MB | fixed 300 MB for Spark internals |
| User memory | 7.5 GB | (heap − 300 MB) × (1 − 0.6) — your objects, UDF data, metadata |
| Storage | 5.6 GB | unified × 0.5 — cached blocks, broadcasts |
| Execution | 5.6 GB | shuffle, sort, join and aggregation buffers — borrows free storage, may evict cache down to the storage region |
| Overhead | 1.9 GB | off-heap: JVM metaspace, threads, netty buffers, Python workers |
spark-submit \
--master yarn \
--deploy-mode client \
--num-executors 30 \
--executor-cores 4 \
--executor-memory 19g \
--conf spark.executor.memoryOverhead=1945m \
--conf spark.dynamicAllocation.enabled=false \
--conf spark.sql.shuffle.partitions=200 \
shuffle_heavy_job.py