-
Notifications
You must be signed in to change notification settings - Fork 5.1k
cleanup memory after UnflushedBytes_HandlesLargeValues test #117115
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
{ | ||
await writer.FlushAsync(); | ||
await writer.CompleteAsync(); | ||
GC.Collect(2, GCCollectionMode.Forced, true, true); |
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 does this help?
Won't other tests running concurrently still experience low memory conditions?
And shouldn't the GC be automatically doing a collection if the memory pressure is so high? And even if it does a collection, that's not going to guarantee it gives the memory back to the OS, and it's the OS' OOM killer that's affecting this, right?
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.
I forced a compacting Gen 2 GC in the hope that it frees enough memory to have some non-ephemeral segments returned to the OS. But as you said, there's no guarantee. I'll investigate a bit more thoroughly
Fixes #117090