Reduce the amount of memory allocated by System.IO.Tests#66387
Reduce the amount of memory allocated by System.IO.Tests#66387adamsitnik merged 4 commits intodotnet:mainfrom
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 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.Testshave 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_DoesNotOverflowallocated 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_DoesNotOverflowwhich allocates 6.5GB and causes other tests which run in parallel to fail with OOM.My proposal:
int.MaxValueSkipTestExceptionon OOM so we can differentiate successful and skipped testThis is nicely reducing the amount of memory used by the
System.IO.Testsand hopefully is still testing what author wanted to test (cc @GrabYourPitchforks)fixes #65791