ANTS Memory Profiler Latest version: 6.0

Knowledge Base

ANTS Memory Profiler total size of all objects does not match the memory footprint of an application

Category: Frequently-asked questions
Date: 17 Jun 2009
Product: ANTS Memory Profiler
When memory profiling results returned by ANTS Profiler are examined, there is usually a disparity between the total size of all objects allocated on the managed heap and the amount of memory shown to be used by the entire process, for example the memory shown in Windows Task Manager.

This is not a bug in ANTS Profiler, but rather a difference in the type of memory being tracked by ANTS Profiler. The total memory used by a .NET application comprises the application image itself, the .NET runtime, and any application extensions (dlls) loaded by the process being profiled. These items are not tracked by ANTS Profiler and therefore are not reflected in the results.

Additionally, .NET memory management typically allocates more heap memory than what is actually requested by your application. Because memory allocation is expensive, .NET will request extra memory for the managed heap and work inside this memory rather than continually requesting more memory from the operating system in smaller increments. For this reason, even the process managed heap size reported by the ".NET CLR Memory" performance object may be larger than what is reported by ANTS Profiler.

In order to see really specific usage information about the memory of a process, the most accurate way is to use a debugger. Red Gate have produced a free tool that leverages Windows debugger in order to graphically display a .NET application's memory space. Memory Tracker can illustrate some of the memory issues discussed in this article. You may download this tool from http://labs.red-gate.com/index.php/Red_Gate_Memory_Tracker .

ANTS Memory Profiler forum