Objects created in a operation

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
jose_minglein
Posts: 3
Joined: Mon Apr 18, 2016 12:20 pm

Objects created in a operation

Post by jose_minglein » Mon Apr 18, 2016 12:28 pm

Hi,

I am investigating the memory consumption of my application with .NET Memory Profiler.

I have a background operation which is doing some actions. When this operation is active I can see in the Real-time view, that the Garbage collection is invoked frequently, however I can not see the objects which are using more memory because they are released, so I can not take snapshot with valid information.

Is it possible to see the most memory consuming created objects in a background operation which is repeated once and again? How?

Best Regards.

Andreas Suurkuusk
Posts: 1000
Joined: Wed Mar 02, 2005 7:53 pm

Re: Objects created in a operation

Post by Andreas Suurkuusk » Tue Apr 19, 2016 9:28 am

When collecting a snapshot you cannot get instance specific information about released instances, but you can get detailed information about the allocations performed for each type. If you collect two snapshots, you will get information about the allocations performed for each type between the snapshots.
Allocations.png
Allocations
You can then double-click one of the types to get more details information about the allocations of a type. Show the allocation call stacks and sort them by "Allocations/sec". Now you will get call stack information about all the allocations of the type. You can browse through the allocation stacks using the navigation buttons.
BytesPerSec.png
Bytes/sec
The "Call stacks/Methods" page can also be used to retrieve allocation information, focusing on the methods/call stacks instead of types.
Best regards,

Andreas Suurkuusk
SciTech Software AB

jose_minglein
Posts: 3
Joined: Mon Apr 18, 2016 12:20 pm

Re: Objects created in a operation

Post by jose_minglein » Tue Apr 19, 2016 10:09 am

Thank you for you answer, I was deeping in that way.

Only one question more.

In real time tab, we see some information of current live instances, allocs/sec, ...

Here, there are points marked in gray where according the legend the garbage collector is triggered. In this information, what the number on the top of the lines means? And is this information reliable? Because, now I am comparing with the memory profiler from VS2015, and according this one, the garbage collector is not executed the same times.

Best Regards.
Attachments
screenshot.png

Andreas Suurkuusk
Posts: 1000
Joined: Wed Mar 02, 2005 7:53 pm

Re: Objects created in a operation

Post by Andreas Suurkuusk » Wed Apr 20, 2016 6:24 am

The number in the top of the line indicates the generation of the collection (i.e. gen 0, 1, 2). The GC information should definitely be reliable. How and when the runtime triggers a GC may be affected by the fact that the process is running under a profiler, but the markers are placed at the time of an actual GC. How does it differ from VS2015?
Best regards,

Andreas Suurkuusk
SciTech Software AB

jose_minglein
Posts: 3
Joined: Mon Apr 18, 2016 12:20 pm

Re: Objects created in a operation

Post by jose_minglein » Mon Apr 25, 2016 8:58 am

Hi,

thanks for you answer.

Visual Studio 2015, executing the same application, shows GC invoctation each minute aprox. On the other hand .NET Memory Profiler each 2 seconds.

I rely .NET Memory Profiler information, but I was surprised about the difference.

Best Regards.

Worign
Posts: 1
Joined: Thu Aug 18, 2016 5:45 am

Re: Objects created in a operation

Post by Worign » Fri Aug 19, 2016 3:32 am

Andreas Suurkuusk wrote:When collecting a snapshot you cannot get instance specific information about released instances, but you can get detailed information about the allocations performed for each type. If you collect two snapshots, you will get information about the allocations performed for each type between the snapshots.
Allocations.png
You can then double-click one of the types to get more details information about the allocations of a type. Show the allocation call stacks and sort them by "Allocations/sec". Now you will get call stack information about all the allocations of the type. You can browse through the allocation stacks using the navigation buttons.
BytesPerSec.png
The "Call stacks/Methods" page can also be used to retrieve allocation information, focusing on the methods/call stacks instead of types.

detailed one! thanks for the info. I was about to ask or post but when I read this one.. I am moved.. thanks! this is a way better than my optional solution.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests