Red Gate forums :: View topic - Private bytes does not appear to match summary
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler Previous Versions
ANTS Memory Profiler Previous Versions forum

Private bytes does not appear to match summary

Search in ANTS Memory Profiler Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
andyinpedro



Joined: 16 Jul 2009
Posts: 1

PostPosted: Thu Jul 16, 2009 10:11 pm    Post subject: Private bytes does not appear to match summary Reply with quote

I can see my private bytes growing consistent with VM memory as provided by task manager. However, the summary of the memory usage isn't nearly as large as the private bytes total. Shouldn't they be the same?
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Fri Jul 17, 2009 11:03 am    Post subject: Reply with quote

No: private bytes includes free space on the .NET heaps as well as unmanaged memory usage. You can find out which is responsible by looking at the breakdown at the bottom of the snapshot summary page: the free space on all .NET heaps value is included in the private bytes.

If this value is large and the largest free block is small, your program is suffering from fragmentation of the large object heap. See http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/ for a description of the problem.

If the value is small, then it's likely that your program is suffering from an unmanaged memory leak of some variety. If the unmanaged memory is being used by .NET objects then you should be able to find the problem by looking for objects whose instance count is increasing, or by looking for objects on the finaliser queue that have not been disposed. The 'Kept in memory only by GC roots of type COM+' filter may also reveal .NET objects that have been leaked through unmanaged code.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
EddieL



Joined: 04 Aug 2009
Posts: 2

PostPosted: Tue Aug 04, 2009 9:19 pm    Post subject: Unmanaged memory leak or large object heap fragmentation? Reply with quote

Hi Andrew,

I have a similar problem in one of my applications. I see in the ANTS Memory Profiler tool that the "Private Bytes" have grown from 45.1MB to 589.6 MB.

In your post you indicate that these Private Bytes include the free space on the .NET heap as well as unmanaged memory usage. I do have some unmanaged code wrapped into a managed .dll that is then used in my C# app, so it all makes sense so far.

In the Summary for my last snapshot I can see that the largest free block is 15MB which is arguably small, compared to the total number of pivate bytes. According to your explanation, this would point to the fact that the application is suffering from large object heap fragmentaton. Would that be accurate?

Cheers,
Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group