-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-12081] Make unified memory manager work with small heaps #10081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The new space used by storage and execution will be calculated by (JVM size - 300MB) * 75%, the `spark.memory.fraction`.
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should document what this is and update the classdoc for UnifiedMemoryManager
|
Test build #2141 has started for PR 10081 at commit |
|
Test build #2140 has started for PR 10081 at commit |
|
Test build #2139 has finished for PR 10081 at commit
|
|
Test build #47025 has finished for PR 10081 at commit
|
|
Thanks I'm merging into master 1.6 |
The existing `spark.memory.fraction` (default 0.75) gives the system 25% of the space to work with. For small heaps, this is not enough: e.g. default 1GB leaves only 250MB system memory. This is especially a problem in local mode, where the driver and executor are crammed in the same JVM. Members of the community have reported driver OOM's in such cases. **New proposal.** We now reserve 300MB before taking the 75%. For 1GB JVMs, this leaves `(1024 - 300) * 0.75 = 543MB` for execution and storage. This is proposal (1) listed in the [JIRA](https://issues.apache.org/jira/browse/SPARK-12081). Author: Andrew Or <[email protected]> Closes #10081 from andrewor14/unified-memory-small-heaps. (cherry picked from commit d96f8c9) Signed-off-by: Andrew Or <[email protected]>
|
Test build #47014 has finished for PR 10081 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For non-small heap, the above memory doesn't need to be reserved, right ?
| val minSystemMemory = reservedMemory * 1.5 | ||
| if (systemMemory < minSystemMemory) { | ||
| throw new IllegalArgumentException(s"System memory $systemMemory must " + | ||
| s"be at least $minSystemMemory. Please use a larger heap size.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes out as scientific notation, which made me laugh.
The existing
spark.memory.fraction(default 0.75) gives the system 25% of the space to work with. For small heaps, this is not enough: e.g. default 1GB leaves only 250MB system memory. This is especially a problem in local mode, where the driver and executor are crammed in the same JVM. Members of the community have reported driver OOM's in such cases.New proposal. We now reserve 300MB before taking the 75%. For 1GB JVMs, this leaves
(1024 - 300) * 0.75 = 543MBfor execution and storage. This is proposal (1) listed in the JIRA.