❔ Unmanaged memory doesn't go down
Question,
I have an ASP.NET Core (.NET 6) application. I use transients and scopes where I can. I can see my disposes being called. I can also see that the memory usage of objects seems pretty healthy, but...
As you can see in the image I posted, the unmanaged memory won't seem to go down. It seems kind of stable, but as you can also see, my managed memory is actually really low (as I could confirm when inspecting snapshots).
For me it seems a bit as if the application keeps the memory reserved to fill up when it needs it for managed memory. But I have absolutely no clue if that is actually how that works.
The screenshot I showed is an application running in Kestrel, the peaks in managed memory were API calls that in turn did some database queries and returned the results. Its ran in release and ASPNETCORE_ENVIRONMENT is not on development.
Could anyone maybe point me in the right direction?
8 Replies
Does dotMemory show you what unmanaged memory is being used?
I cannot inspect what is in the unmanaged memory, can I?
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
I have a few services that are being called which should be and are disposable
Can you call the service continuously and see if the memory continually goes up? If so, congrats, you have a memory leak.
If not, I probably wouldn't worry about it.
As you can see on the blue spikes it goes up but then settles again. It's the unmanaged that stays very high. But doesn't continually go up either
So it's probably fine
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.