dotMemory explanation

Hi!

I have a quesiton.
I'm digging into the dotMemory, trying to understand how to use it and interpret the figures.
I have one question though, that I'm hoping that you can shed some light on.
When I create a very simple asp.net web api (dotnet framework), and adding one controller to it that returns a string. That's all, nothing else.

When firing up the dotMemory profiling it reveals that all the time I put a bunch of calls on this api, on the controller that just reverts a string, the dotMemory increases initally, and goes down. But it never goes back to the point that it was before the call. It always increases.. Putting a bunch of calls on the api controller again, it still increases, all the time. It goes down a bit for sure, but never as much it increases. Is this correct? Is the dotMemory showing me that the very simple web api with one controller which returns a string, doesn't dispose itself so far to the point it was before the calls I sent in?

Thank you!

3 comments
Comment actions Permalink

Hi Johan,

CLR may keep 'free' memory blocks in the heap after GC even if objects is collected. Free memory is a block of memory which has no references to it and is available for allocation. This optimization allows to allocate objects faster. Probably this is the reason of Gen0 increasing in your case.

You can get a snapshot and check if any objects survived after GC. If Gen0 object survives after GC it'll be promoted to the Gen1. If you get a snapshot in dotMemory and open Inspections view (click on Snapshot name to do it) you'll get information about used and free memory in heaps after GC. You can also open objects contained in certain heap from "Generations" view.
0
Comment actions Permalink

Hi Anna!

Thanks for your input.
I have read the info regarding the dotMemory:
https://www.jetbrains.com/help/dotmemory
I have some trouble to distinguish my code from the asp.net mvc "internal stuff". Do you have any best practice, some classes that I shouldn't take in consideration when investigating?
Do you offer some kind of private session where I can get input from Jetbrains how I should interpret what I see on the screen/analyse?

Thank you!

0
Comment actions Permalink

Johan,

> I have some trouble to distinguish my code from the asp.net mvc "internal stuff".

You can try "Group by namespace" view. This type of grouping is very convenient when you want to concentrate in determining issues in your own classes. You can open all classes of certain namespace as a separate object set.

 

> Do you offer some kind of private session where I can get input from Jetbrains how I should interpret what I see on the screen/analyse?

We don't offer a private session but we have a lot of materials which can help you in investigation. You can find most of them in standalone dotMemory on 'Home | Help & Tutorials' page. Also we can recommend to read eBook which includes our vision of best practices in finding and solving memory issues in .NET applications: https://leanpub.com/detectingandsolvingmemoryproblemsinnet

0

Please sign in to leave a comment.