-
Notifications
You must be signed in to change notification settings - Fork 149
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
Stop leaking JoinableTask via ExecutionContext #348
Conversation
Fix memory leak tests on netcoreapp2.0 debug configuration
Fixes microsoft#274 and gets the recently added test to pass
This should reduce allocations
/// <summary> | ||
/// Gets a weak reference to this object. | ||
/// </summary> | ||
internal WeakReference<JoinableTask> WeakSelf |
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 sounds a cool idea to address this problem. Thanks a lot to take care of it.
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.
Looks good to me. I guess the same weakReference is not reused in the JoinableTaskCollection. not sure whether it is worth to do or not...
Thanks for the review, @lifengl. Ya, I took a quick look at |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes #274 and gets the recently added test to pass
As part of this, I consolidate several places we create weak references to
JoinableTask
so we can share those instances, thus reducing GC pressure.