-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Reduce the amount of memory allocated by System.IO.Tests #66387
Conversation
reduce the size use same memory for input and output
…in parallel, as it can cause OOM
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsRecently The number of live objects goes back to previous value (or a very similar number) after each GC collection, so I don't think that we have introduced a memory leak to the product itself. However, one of the tests, namely runtime/src/libraries/System.IO/tests/BinaryWriter/BinaryWriter.EncodingTests.cs Lines 191 to 192 in 57bfe47
I guess (I have no memory dump from the CI) that the problem is caused by My proposal:
This is nicely reducing the amount of memory used by the fixes #65791
|
src/libraries/System.IO/tests/BinaryWriter/BinaryWriter.EncodingTests.cs
Show resolved
Hide resolved
/azp run runtime-libraries-coreclr outerloop-linux |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks for taking care of this @adamsitnik |
Recently
System.IO.Tests
have started failing with OOM on Unix-like OSes. Since the CI has not produced any dump file and according to my knowledge we don't offer any memory profiler for Linux, I've used VS Memory Profiler to profile System.IO.Tests on Windows.The number of live objects goes back to previous value (or a very similar number) after each GC collection, so I don't think that we have introduced a memory leak to the product itself.
However, one of the tests, namely
WriteChars_VeryLargeArray_DoesNotOverflow
allocated 6.5 GB and it has already been causing OOMs in the past as it's marked to skip on Android:runtime/src/libraries/System.IO/tests/BinaryWriter/BinaryWriter.EncodingTests.cs
Lines 191 to 192 in 57bfe47
I guess (I have no memory dump from the CI) that the problem is caused by
WriteChars_VeryLargeArray_DoesNotOverflow
which allocates 6.5GB and causes other tests which run in parallel to fail with OOM.My proposal:
int.MaxValue
SkipTestException
on OOM so we can differentiate successful and skipped testThis is nicely reducing the amount of memory used by the
System.IO.Tests
and hopefully is still testing what author wanted to test (cc @GrabYourPitchforks)fixes #65791