Skip to content
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

.NET core 2.1 memory management on containers #2

Open
passuied opened this issue Nov 8, 2018 · 0 comments
Open

.NET core 2.1 memory management on containers #2

passuied opened this issue Nov 8, 2018 · 0 comments

Comments

@passuied
Copy link

passuied commented Nov 8, 2018

Hi Sebastien,

Thanks for this analysis that has been really helpful to understand garbage collection behavior in .NET core.

We have been investigating some weird memory issues on docker containers running aspnet core 2.1.5. I have been using your bigstring endpoint example as benchmark...
What we're finding is that in .NET core 2.1, when constraining container memory to 256MB or less and applying some load, the memory quickly jumps up until the container dies.
If only limiting to 512MB, the memory jumps all the way to 480MB, then drops to 280MB and stays stable...

Changing <ServerGarbageCollection> to false solves the problem but given the fact it seems the surge only happens initially, it seems something should be fixed at .NET Core level to make sure it respects the memory limit set.

Please also note that if we are also constraining the CPU, the memory stays under control (around 130MB). Memory limit therefore seems linked to number of CPUs available (as indicated in https://blog.markvincze.com/troubleshooting-high-memory-usage-with-asp-net-core-on-kubernetes/)

Finally, please note that when running the same service on .NET Core 2.0, the memory only jumps to 200MB (80%) ... so this behavior seems to be new in 2.1

Is this a known issue?

I might post an issue in the dotnet repo but given your history on this topic, I though I would post this here first...
Thanks,
Patrick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant