-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-6076][Block Manager] Fix a potential OOM issue when StorageLevel is MEMORY_AND_DISK_SER #4827
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
|
Test build #28118 has started for PR 4827 at commit
|
|
Test build #28118 has finished for PR 4827 at commit
|
|
Test PASSed. |
|
CC @andrewor14 |
|
CC @andrewor14 again in case it was missed. |
|
Sorry for the delay. I was away for a little more than a week and I will look at this later today. |
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.
could you add a // comment here that links to this JIRA? Otherwise it's not clear why we need to do this lazily.
|
@zsxwing the approach looks reasonable. I'm wondering if there's a more readable way to do the same thing. In particular, currently this uses call-by-name ( |
|
@andrewor14 is it acceptable that changing call-by-name to |
|
@andrewor14 I updated to use |
|
Test build #28976 has started for PR 4827 at commit
|
|
Test build #28976 has finished for PR 4827 at commit
|
|
Test PASSed. |
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.
it's a little odd for this to be () => bytes everywhere. Can you create an alias that looks something like:
private def tryToPut(blockId: BlockId, value: Any, ...): ResultWithDroppedBlocks = {
tryToPut(blockId, () => value, ...)
}
such that we only use the lazy version if we have to. Same for dropFromMemory
|
Thanks @zsxwing I left one more code style comment and I think it's ready after that. |
|
Test build #29137 has started for PR 4827 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.
Instead of duplicating the javadocs here I would just refer to the other method. I can fix this when I merge don't worry.
|
LGTM. I will merge this once tests pass thanks. |
|
Test build #29137 has finished for PR 4827 at commit
|
|
Test PASSed. |
|
Merged this into master. |
In
spark/core/src/main/scala/org/apache/spark/storage/BlockManager.scala
Line 538 in dcd1e42
MEMORY_AND_DISK_SER, it will copy the content from file into memory, then put it into MemoryStore.However, if the file is bigger than the free memory, OOM will happen. A better approach is testing if there is enough memory. If not, copyForMemory should not be created, since this is an optional operation.