-
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
[mono][interp] Fix some leaks during compilation #97143
Conversation
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsShould fix out of memory on
|
so dotnet8.0 have this problem? this line also have memory leak? runtime/src/mono/mono/mini/interp/transform.c Line 3169 in 77d643d
|
The target method and, implicitly, its signature are already inflated. This was allocating a new signature every time the method was called which was leaked. On some of the bigger tests suites, that heavily use generics, this can reduce the mem usage in the order of GBs.
The header local types are not used anywhere so we can just free it.
d8ed69c
to
1158ea0
Compare
@srxqds The header leak is rather negligible, this header leak fix will likely not have a big impact. We still keep some data around more than needed, but it should be negligible. The method signature leak is more significant, it exists on .net8, but it is unlikely to be problematic in a typical application, since it is bounded by the number of methods that are compiled which is limited. It was showing more on our test suites, since they can be very heavy, and in tests suites you have thousands of tests that are compiled and run only once, so it was starting to show up there. |
The browser-wasm linux Release LibraryTests_EAT failure is unrealted. |
* [mono][interp] Stop trying to inflate signature The target method and, implicitly, its signature are already inflated. This was allocating a new signature every time the method was called which was leaked. On some of the bigger tests suites, that heavily use generics, this can reduce the mem usage in the order of GBs. * [mono][interp] Free mheader in case of inline failure The header local types are not used anywhere so we can just free it.
Should fix out of memory on
System.Numerics.Tensors.Tests
. These seem to be sporadically failing, maybe since #94555