# Off-heap memory

Glossary, read 10 Nov 2026

**The short answer.** Off-heap memory is memory Spark or a plugin allocates outside the JVM heap. The setting spark.memory.offHeap.size defaults to 0 and must be a positive value when spark.memory.offHeap.enabled is true. Native engines such as Gluten and Comet need an off-heap pool because their C++ or Rust code allocates there.

Off-heap use is why native plugins ask for new memory settings. The total container size still has to fit your executor limit, so the JVM heap usually shrinks when you grow the off-heap pool.

The Spark documentation notes the setting has no effect on heap usage, so if executors must fit a hard limit you shrink the heap yourself.

## A sourced example

Comet's TPC-DS benchmark configuration used spark.memory.offHeap.size=32G with 64G executor memory, 10G overhead and spark.comet.exec.memoryPool.fraction=0.8.

## Sources

- Apache Spark configuration reference: memory: https://spark.apache.org/docs/latest/configuration.html (read 10 Nov 2026)

Last reviewed 10 Nov 2026. Canonical: https://sparkaccelerationcompare.com/glossary/off-heap-memory/
