I have a process holding 130MB of memory according to task manager, with only 11MB of live .NET objects according to dotTrace so I am wondering what's happening with the other 120MB??
I'd need a tool to list assemblies and native DLLs loaded in a process, gets the size of the images in process, and, for each assembly, measure the memory footprint of the methods JITed.
ListDlls from SysInternal does partly that job. But it doesn't measure JITed code size and it just provides raw data. Ideally I'd like a UI to analyze and sum-up these data.
Recently, the Visual Studio team reported having done such analysis with the tool PerfView. This is stated in the blog post Visual Studio 11 Beta Performance Part #1, section: The Biggest VM Consumer - DLLs. Does someone has experience and feedback analyzing native Dlls and assemblies footprint with PerfView?
Except ListDlls and PerfView, would you recommend any other tool?
Ok, VMMAP advised by Simon Mourier seems to be the more suited tool for this task. VMMAP shows that the bulk of working set memory goes into the Managed Stack (113MB in green below), so the problem is more related to .NET objects than unmanaged memory. The green saw tooth curve, is just a timeline of loading/unloading sessions. For some reasons, my first measures were quite wrong:
- dotTrace tells me I have 41MB of .NET objects allocated,
- WMMAP shows a working set of 180MB (task manager shows a similar number)
- WMMAP shows 113MB of managed heap allocated by the GC. 90MB of this managed heap memory is in the working set:
So my plan is:
- Identify why the GC allocates 113MB of managed heap for 41MB of .NET objects? (are such numbers normal? is it due to high fragmentation?)
- Work on shrinking this 41MB set of .NET objects allocated!