ANTS Memory Profiler

Latest version: 7.4

ANTS Memory Profiler

Knowledge Base

General information about "Private Bytes"

Category: Troubleshooting & error messages
Date: 29 Mar 2010
Product: ANTS Memory Profiler
ANTS Memory profiler indicates private bytes usage but doesn't break this down further.

Private bytes includes free space on the .NET heaps as well as unmanaged memory usage.
At the bottom of the snapshot summary page you can see the free space on all .NET heaps 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.
For a description of the problem, see: http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/

You'll know when you have large object heap fragmentation as the heap bytes will take up significant space- often as much, if not more than private bytes.
Use this simple rule of thumb: bytes in heap = managed objects; unmanaged objects = private bytes - bytes in heap.
If you have a large use of private bytes, but not much heap bytes- the problem is very likely to be unmanaged object leaks
which the memory profiler does not give further information for since it only profiles managed memory in detail.
To get to the source of the problem- try to isolate the managed objects that are using unmanaged objects and see why they are being kept in
memory using the filters.
If the value is small, then its 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 finalizer 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.

Document ID: KB201003000463 Keywords: ANTS,Memory,private,bytes,leak,COM

Was this article helpful?

Search support
Forums

ANTS Memory Profiler

all products