Unmanaged legend's chart value increasing

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Unmanaged legend's chart value increasing

Postby winanjaya » Fri Dec 23, 2011 4:56 am

Dear All,

I am evaluating ANTS
I am running Memory Profiler for my Winform C# application, when I see the summary then I was wondered that
the Unmanaged legend's chart value was 25.2MB and it would getting bigger and bigger after
repeatly I click "Take Memory Snapshot"

why... and what does it meant? .. does it also the one that causing System.OutOfMemory Exception?

and FYI,

Generation 1 was dynamically increased and reduced until 0 bytes.
Generation 2, Large Object Heap and Unused memory allocated to .NET were also dynamically increased and reduced

could any body please advise?

many thanks in advance

Regards
Winanjaya
winanjaya
 
Posts: 4
Joined: Fri Dec 23, 2011 4:53 am

Postby Laura Morley » Fri Dec 23, 2011 10:36 am

Hi Winanjaya -

It sounds like you might have a leak in your application's unmanaged code.

Have you tried reading our advice on checking unmanaged memory usage? That might give you some pointers toward understanding what's going on in your application.

Does that help at all?
Laura Morley
 
Posts: 34
Joined: Wed Jun 22, 2011 2:13 pm
Location: Red Gate Software

Postby winanjaya » Fri Dec 23, 2011 10:56 am

yes, I read the article on http://www.red-gate.com/supportcenter/C ... anaged_use

on part of
"To identify the cause of large amounts of unmanaged memory usage"

I checked the Class List and switch to Filter By Reference. then Select Kept in memory exclusively by "Disposed objects" .. and there is no any object in Class List..(I tried to clicked "Take Memory snapshots" many times with no luck)

any comment or suggestion?..

please help

Thanks a lot in advance

Regards
Winanjaya
winanjaya
 
Posts: 4
Joined: Fri Dec 23, 2011 4:53 am

Postby Laura Morley » Tue Jan 03, 2012 10:56 am

Sorry that didn't help. Does your WinForms application use graphics buffers? These are reasonably commonly the cause of unmanaged leaks. If it does use graphics buffers, these steps might help you find the problem:

1. Switch to the Class List.
2. On the Filters panel, switch to the Filter by Object Type tab and select Objects that implement.
3. Click Add class / interface, and choose System.Image.
4. Switch to the Instance List and sort it by Distance from GC Root.
5. Look at the instances which are furthest from the GC Root. This is because leaked images are likely to be further from the root.
6. Use the instance retention graph to work out why each image is still in memory; see The Instance Retention Graph.
7. If you do not see the cause of the memory problem, repeat the steps above using Objects that implement System.Windows.Media.Imaging.CachedBitmap. If this still doesn't show the cause of the memory problem, repeat the steps again using Objects that implement System.Windows.Media.ImageSource.

Does any of that help?
Laura Morley
 
Posts: 34
Joined: Wed Jun 22, 2011 2:13 pm
Location: Red Gate Software

Postby Laura Morley » Tue Jan 03, 2012 5:50 pm

If that still doesn't reveal the cause, here's another approach you can try (adapted from a suggestion by our developer Andrew):

1. Take a snapshot shortly after your program starts, and another after the memory usage has grown.
2. In the Class List, apply the survivors in growing classes filter, then sort by the Instance diff column.
With this filter applied, this column will be showing you the number of objects in each class that have been garbage collected between snapshots (with shrinking or static long-lived objects filtered out). Classes with a difference of 0 are very good candidates to be leaking, and may be worth investigating.
3. Switch to the Instance Categorizer. Filter by Survivors in growing classes to see why old instances of the class are remaining in memory.
4. Now apply the New objects filter: this will show you new instances of classes that are causing memory usage to grow.

These steps should help you to see where the objects that make up your unmanaged memory leak are coming from.
Laura Morley
 
Posts: 34
Joined: Wed Jun 22, 2011 2:13 pm
Location: Red Gate Software


Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 1 guest