-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-4231 Fast Path for sweep during FullGC #11923
DYN-4231 Fast Path for sweep during FullGC #11923
Conversation
# Conflicts: # src/Engine/ProtoCore/DSASM/Heap.cs
src/Engine/ProtoCore/DSASM/Heap.cs
Outdated
exe.rmem.Push(StackValue.BuildArrayDimension(0)); | ||
exe.rmem.Push(StackValue.BuildPointer(svPtr.Pointer, svPtr.metaData)); | ||
exe.rmem.Push(StackValue.BuildInt(1)); | ||
|
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.
Why have these lines been 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.
This was not necessary with the new route and would be a memory leak. Also FYI in Dynamo today it does seem to have a memory leak regardless. We always add 3 items but only ever Pop two.
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.
Many thanks @aparajit-pratap for your insights. I have been trying to break this in various ways, unsuccessfully so far. It works well. In many cases where it currently takes 10-15 times longer to dispose objects than it takes to create them it now takes about the same time to create and dispose. I am also seeing about 20% less memory being used.
@saintentropy You have 4 test failures now. |
disposeArguments[0] = stackValue; | ||
|
||
//EXECUTE | ||
return finalFep.Execute(null, disposeArguments, null, runtimeCore); |
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.
Why is the context (first arg) passed as 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.
Only because for this execution path it was not referenced.
Purpose
https://jira.autodesk.com/browse/DYN-4231
The purpose of this PR is to optimize the Sweep pass for the FullGC pass that occurs after any change to the graph that causes re-execution. Specifically this optimization does the rolling:
CallDispose
) tailored specifically for dispatching Dispose calls vs allowing these calls from the GC to pass through the genericCallr
. Additionally it introduces a specific Dispatch method to the Callsite ('DispatchDispose) also tailored to Dispatch Dispose calls vs
Dispatch. In both case the normal overhead of the
Callrand
Dispatchis much higher and .NET memory/GC intensive than the actual
Dispose` calls.In testing a graph that had ~150000 items to collect in the sweep pass the time was reduced from 2s to .5s and the .NET memory allocation from 800mb to 16mb.
Todo is to validate with testing include DS object dispose.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
TBD
FYIs
@jasonstratton @QilongTang