C
C#17mo ago
Wabsta

❔ 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
Denis
Denis17mo ago
Does dotMemory show you what unmanaged memory is being used?
Wabsta
WabstaOP17mo ago
I cannot inspect what is in the unmanaged memory, can I?
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Wabsta
WabstaOP17mo ago
I have a few services that are being called which should be and are disposable
mtreit
mtreit17mo ago
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.
Wabsta
WabstaOP17mo ago
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
mtreit
mtreit17mo ago
So it's probably fine
Accord
Accord17mo ago
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.
Want results from more Discord servers?
Add your server