Apache Spark Big Data (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What are the memory regions in Spark's Unified Memory Manager?
senior LevelSystem Design
In Simple Words: An Executor's memory is divided into:
- Reserved Memory (300 MB): Hardcoded for Spark internal system processes.
- User Memory (25% of remaining): Stores user data structures, UDF variables, and metadata.
- Spark Memory (75% of remaining):
- Execution Memory: Used for shuffles, joins, sorts, and aggregations.
- Storage Memory: Used for cached DataFrames (
cache(),persist()) and broadcast variables. - Dynamic Borrowing: Execution and Storage can dynamically borrow memory from each other! Execution has priority and can evict storage.