-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-15045] [CORE] Remove dead code in TaskMemoryManager.cleanUpAllAllocatedMemory for pageTable #12829
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
Issue number SPARK-15045. Removed Dead-code.
| consumers.clear(); | ||
| } | ||
|
|
||
| for (MemoryBlock page : pageTable) { |
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 not clear this code should be removed, though I agree right now it appears to be dead code because of line 382. CC @JoshRosen since I think you added this block? should line 382 just be removed?
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.
@davies in L382 we null out the pageTable so this loop doesn't do anything. However, I don't think we should delete this code. Should we just remove L382? Is this a cause for memory leaks?
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.
Chatted with @JoshRosen , these lines are introduce by logical conflict, it could be rewritten as
synchronized (this) {
for (MemoryConsumer c: consumers) {
if (c != null && c.getUsed() > 0) {
// In case of failed task, it's normal to see leaked memory
logger.warn("leak " + Utils.bytesToString(c.getUsed()) + " memory from " + c);
}
}
consumers.clear();
for (MemoryBlock page : pageTable) {
if (page != null) {
logger.warn("leak a page: " + page + " in task " + taskAttemptId);
memoryManager.tungstenMemoryAllocator().free(page);
}
}
Arrays.fill(pageTable, null);
}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.
that LGTM. @abhi951990 can you update this patch to reflect that?
|
@abhi951990 I think maybe it would be nicer if the title is more specific just like the title of this JIRA ticket. I think it would be even nicer if the title follows the format like others such as |
|
ok to test |
|
Test build #57700 has finished for PR 12829 at commit
|
|
@abhi951990 I don't think this is dead code. It seems to be a potential bug. |
|
@andrewor14 So should I only delete line 382? Or should I leave as it is? |
|
Let's see what @davies thinks. |
|
Test build #57835 has finished for PR 12829 at commit
|
|
LGTM, merging into master, thanks! |
…AllocatedMemory for pageTable ## What changes were proposed in this pull request? Removed the DeadCode as suggested. Author: Abhinav Gupta <[email protected]> Closes #12829 from abhi951990/master. (cherry picked from commit 1a5c6fc) Signed-off-by: Davies Liu <[email protected]>
…UpAllAllocatedMemory for pageTable apache#12829
What changes were proposed in this pull request?
Removed the DeadCode as suggested.