I'm not exactly sure of which version you're on, so I'll make this answer for version 3.3.1 (latest version at the time of writing this post):
We can understand what those 2 numbers are by looking at the HTML code that generates this page.
- Storage Memory: Memory used / total available memory for storage of data like RDD partitions cached in memory.
- On Heap Storage Memory: Memory used / total available memory for on heap storage of data like RDD partitions cached in memory.
- Off Heap Storage Memory: Memory used / total available memory for off heap storage of data like RDD partitions cached in memory.
Storage Memory is indeed the sum of On Heap and Off heap memory usage, both for:
/**
* Storage memory currently in use, in bytes.
*/
final def storageMemoryUsed: Long = synchronized {
onHeapStorageMemoryPool.memoryUsed + offHeapStorageMemoryPool.memoryUsed
}
/** Total amount of memory available for storage, in bytes. */
private def maxMemory: Long = {
memoryManager.maxOnHeapStorageMemory + memoryManager.maxOffHeapStorageMemory
}
- The off heap storage memory comes purely from the
spark.memory.offHeap.size
parameter, as can be seen here:
protected[this] val maxOffHeapMemory = conf.get(MEMORY_OFFHEAP_SIZE)
protected[this] val offHeapStorageMemory =
(maxOffHeapMemory * conf.get(MEMORY_STORAGE_FRACTION)).toLong
This MEMORY_OFFHEAP_SIZE
is defined by spark.memory.offHeap.size
:
private[spark] val MEMORY_OFFHEAP_SIZE = ConfigBuilder("spark.memory.offHeap.size")
.doc("The absolute amount of memory which can be used for off-heap allocation, " +
" in bytes unless otherwise specified. " +
"This setting has no impact on heap memory usage, so if your executors' total memory " +
"consumption must fit within some hard limit then be sure to shrink your JVM heap size " +
"accordingly. This must be set to a positive value when spark.memory.offHeap.enabled=true.")
.version("1.6.0")
.bytesConf(ByteUnit.BYTE)
.checkValue(_ >= 0, "The off-heap memory size must not be negative")
.createWithDefault(0)