Reading Memory in the UI

Each region from this lesson leaves a trace in the Spark UI, spread across 3 places: the Executors tab, the Storage tab, and the detail page for each stage. Walking them in that order narrows a memory problem to a single region.

Executors tab: unified memory per executor

Each executor gets a row. Storage Memory reads as used over total, for example 2.3 GiB / 4.4 GiB. The total is the whole unified region, since storage may borrow all of it, and it lands a little below the formula's 4,735 MB (4.6 GiB) because the JVM reports slightly less heap than it was given. Disk Used counts cached blocks held on local disk. Among the tab's additional metrics, Peak JVM Memory shows the most heap the process ever used. Task Time (GC Time) turns red when garbage collection takes more than 10% of task time, a sign the heap is crowded with live objects.

Storage tab: what survived in the cache

Each cached DataFrame gets a row, with its Storage Level, Cached Partitions, Fraction Cached, Size in Memory and Size on Disk. Under MEMORY_ONLY, evicted partitions leave the cache, so Fraction Cached falls below 100%. Under a memory-and-disk level, they move from Size in Memory to Size on Disk, and Fraction Cached can stay at 100% while the cache quietly slows down.

Stage page: execution memory per task

Open the slowest stage. Its summary metrics give Peak Execution Memory, Spill (Memory) and Spill (Disk) as quantiles, and its task table lists failed tasks with their error, which is where ExecutorLostFailure shows up.

From symptom to region

What you seeRegion under pressureFirst move
Spill on most tasks, peaks near each task's shareExecution, in unified memoryMore shuffle partitions, or fewer cores per executor
Spill on the max task onlyExecution, from skewed inputSalt or isolate the hot key
Fraction Cached below 100%, or Size on Disk climbing during joinsStorage, in unified memoryCache fewer columns, or unpersist sooner
`java.lang.OutOfMemoryError: Java heap space` in an executor logUser memory, or the heap as a wholeLess data per task, or more heap
`ExecutorLostFailure`, exit code 137, no heap errorOverhead, outside the heapRaise `spark.executor.memoryOverhead`
GC Time in redHeap crowded with live objectsCheck cache size and per-task data first

A report reads a DataFrame persisted with MEMORY_ONLY, after a large join ran on the same executors. Which reading tells you whether part of that DataFrame had to be recomputed?

Putting the readings together

A job caches trips_enriched with cache() on the running-example executors, then runs a heavy aggregation over it. No task fails. Mid-stage, the Executors tab and the stage's summary metrics read as follows.

Which reading of these numbers is right, and what is the first move?

About this lesson

This section is part of the Memory and Caching: Intermediate lesson on DataDriven, the home of data engineering. Lessons cover SQL, Python, Spark, data modeling and pipeline architecture, and each section pairs its explanation with worked examples and practice you run as you go.