-
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
Plagued with 'System.OutOfMemoryException' errors in .NET 7 Preview 4 #70718
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/gc Issue DetailsI'm running a basic but memory & CPU intensive .NET 7 app with an API, on a Web Server 2016, but after it runs for a while, I'm running into continual 'System.OutOfMemoryException' errors in various parts of the program, especially as the memory usage grows, but not sure if this is related to max RAM usage as it's less than but almost 95% full (works fine with .NET 6 and same & higher RAM usage). Some of the errors are showing as follows:
At least one example of the issue happens on the following line of code that operates on a Stream: Deployment machine:
(unable to test on other hardware at this time due to large RAM usage that I don't have elsewhere)
|
We have enabled GC regions functionality in preview3 which has changed some heuristics. Are you observing this behavior on machines with large available memory > 256gb or with lower available memory too? Will try to repro.. |
@littlehoneybunnytuttifruttipumpkinpie could you please try your repro after setting |
Closing this based on the fix above. @littlehoneybunnytuttifruttipumpkinpie please validate on preview7 to check if its indeed fixed. |
I'm running a basic but memory & CPU intensive .NET 7 app with an API, on a Web Server 2016, but after it runs for a while, I'm running into continual 'System.OutOfMemoryException' errors in various parts of the program, especially as the memory usage grows, but not sure if this is related to max RAM usage as it's less than but almost 95% full (works fine with .NET 6 and same & higher RAM usage).
The issue happens with .NET 7 Preview 4, while same program works fine with .NET 6. I have not tested previous .NET 7 preview versions.
The errors seem to appear in several/different parts of the program, each performing variety of functions unrelated to each other.
The errors are also repeating (in similar parts of the program as previously) after restarting the program and after it runs for a while, filling up memory.
The program mainly loads data from Zip files, uncompresses it and stores it in static Dictionary to be served via API. It does the same operation in a loop, so no difference in behavior over time, just the memory errors happen after a while and after RAM usage is increasing).
Some of the errors are showing as follows:
At least one example of the issue happens on the following line of code that operates on a Stream:
while ((cnt = src.Read(bytes, 0, bytes.Length)) != 0) dest.Write(bytes, 0, cnt);
Deployment machine:
(unable to test on other hardware at this time due to large RAM usage that I don't have elsewhere)
Not sure how to help debug this issue, while for now I'm going back to .NET 6 just to be able to run the program properly.
The text was updated successfully, but these errors were encountered: