Page 1 of 1

Hidden allocation call stacks

Posted: Wed Jun 15, 2011 4:07 pm
by erik
I am using Memory Profiler to analyze unmanaged memory allocations. I have symbols configured correctly and I set the following options:
- disable stack reducer
- set maximum stack depth to (unlimited)
- enable perform native stack walk
- enable perform stack walk on managed entry

On the Resource details tab, I've selected "Kernel-HeapMemory" as the Resource. The page lists 1000s of instances, some of which are dimmed. When I select the dimmed instances, the Call stack view displays the message "Allocation call stack is hidden for the selected instance(s)", regardless of the state of the "Hide stacks with zero sort value" checkbox or the "Sort stacks by" combobox.

1) Why are these call stacks hidden for these instances? Is there any way to see these call stacks?
2) The list of instances is truncated because there are so many. Is there any way to see the instances that not shown because of the truncation?


Re: Hidden allocation call stacks

Posted: Sun Jun 19, 2011 2:13 pm
by Andreas Suurkuusk
To avoid presenting duplicate memory usage, .NET Memory Profiler will hide nested memory allocations. For example, when you make a call to the C function malloc, the malloc function will call the Win32 function HeapAlloc. Both of these functions are tracked by the profiler, but the memory allocated by the nested call to HeapAlloc will be ignored when aggregating total instances and bytes count. If the nested allocation wasn't ignored, then twice as much memory would be reported as allocated.

In the instance list, even the ignored instances are presented, but they are dimmed. However, they are not included in the call stack summary presented to the right, so the call stack will always be hidden for the ignored instances. To get call stack information for the ignored instances, you will need to double-click the instance and view the instance details.