-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[WIP] Spark-1392: Add parameter to reserve minimum memory for the system and increase default executor memory #377
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ there are at least five properties that you will commonly want to control: | |
| <tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr> | ||
| <tr> | ||
| <td>spark.executor.memory</td> | ||
| <td>512m</td> | ||
| <td>1g</td> | ||
| <td> | ||
| Amount of memory to use per executor process, in the same format as JVM memory strings (e.g. <code>512m</code>, <code>2g</code>). | ||
| </td> | ||
|
|
@@ -102,24 +102,32 @@ Apart from these, the following properties are also available, and may be useful | |
| <code>reduceByKey</code>, etc) when not set by user. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td>spark.system.reservedMemorySize</td> | ||
| <td>300m</td> | ||
| <td> | ||
| Constant amount of heap to reserve on executors for Spark's own code and user code. Taken into account before calculating | ||
| memory available for and shuffle as configured in <code>spark.storage.memoryFraction</code> and | ||
| <code>spark.shuffle.memoryFraction</code>. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td>spark.storage.memoryFraction</td> | ||
| <td>0.6</td> | ||
| <td> | ||
| Fraction of Java heap to use for Spark's memory cache. This should not be larger than the "old" | ||
| generation of objects in the JVM, which by default is given 0.6 of the heap, but you can increase | ||
| it if you configure your own old generation size. | ||
| Fraction of Java heap to use for Spark's memory cache, after accounting for <code>spark.system.reservedMemorySize</code>. | ||
| The effective size should not be larger than the "old" generation of objects in the JVM. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td>spark.shuffle.memoryFraction</td> | ||
| <td>0.3</td> | ||
| <td> | ||
| Fraction of Java heap to use for aggregation and cogroups during shuffles, if | ||
| <code>spark.shuffle.spill</code> is true. At any given time, the collective size of | ||
| all in-memory maps used for shuffles is bounded by this limit, beyond which the contents will | ||
| begin to spill to disk. If spills are often, consider increasing this value at the expense of | ||
| <code>spark.storage.memoryFraction</code>. | ||
| Fraction of Java heap to use for aggregation and cogroups during shuffles, after accounting for | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence reads a little weird. Move "if spark.shuffle.spill is true," to the front? |
||
| <code>spark.system.reservedMemorySize</code>, and if <code>spark.shuffle.spill</code> is true. | ||
| At any given time, the collective size of all in-memory maps used for shuffles is bounded by this | ||
| limit, beyond which the contents will begin to spill to disk. If spills are often, consider increasing | ||
| this value at the expense of <code>spark.storage.memoryFraction</code>. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 seems a bit high - I spoke with @aarondav and we were thinking 200m might be a better default for this. He said after GC the actual space used ends up being ~100m. The issue with setting it too high is that it might falsely reserve un-used space.
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.
Let's talk more during the QA phase to figure out the right numbers. I've actually got a test I'm running that still OOMs at 300m, but does fine when at 350m.