I am having problems with a Windows Server 2012 class machine, which sometimes increases its managed .net heap to over 10 GB (usually it should be 1-2 GB). I took the memory in this field after the Gen2 collection to try to find which objects get on the heap.
Using WinDbg / SOS
!dumpheap -stat
creates a list of objects, the largest of which is ~ 150 mb of memory, and quickly ends. Pulling this output into excel and adding TotalSize, I get only 1.5 GB of objects (in accordance with what I expect).
MT Count TotalSize Class Name 00007ffb1ab87a70 1 24 System.Collections.Generic.GenericEqualityComparer`1[[System.UInt64, mscorlib]] ... 00007ffabc178e40 218274 36670032 Ten.RunBar 00007ffabbd172f8 1048576 41943040 Ten.DisruptorTaskTuple 00007ffb1a0502c0 442990 71357200 System.Object[] 00007ffabc1bbce0 676327 97391088 Ten.BalTuple 00007ffabbd5eea8 2342912 149946368 Ten.Run.TaskAction 0000001bf119dc70 1072558 787427166 Free MANUALLY CALCULATED TOTAL: 1589298584
My first thought is that there is some unmanaged memory leak, so I checked the heap with
!EEHeap -gc
which showed that the GC heap size itself is actually 10 GB
Number of GC Heaps: 1 generation 0 starts at 0x0000001e10623cb0 generation 1 starts at 0x0000001e10485bb0 generation 2 starts at 0x0000001b80001000 ephemeral segment allocation context: none segment begin allocated size 0000001b80000000 0000001b80001000 0000001b90000000 0xffff000(268431360) 0000001b98000000 0000001b98001000 0000001ba8000000 0xffff000(268431360) ... 0000001e04ee0000 0000001e04ee1000 0000001e109c2cc0 0xbae1cc0(195960000) Large object heap starts at 0x0000001b90001000 segment begin allocated size 0000001b90000000 0000001b90001000 0000001b9356cbc8 0x356bbc8(56015816) Total Size: Size: 0x25f028618 (10183935512) bytes.
I confirmed that the memory is in the heap of the second generator (performance counter), but I don't know where to look for the missing 8.5 GB of managed objects here.
Any other ideas / WinDbg / SOS commands to help find them?
Superman
source share