[Mono-list] Heap-Shot with no GUI.

Paolo Molaro lupus at ximian.com
Fri Nov 19 10:16:25 EST 2010

On 11/19/10 Esben Laursen wrote:
>          Heap shot 10 at 331.831 secs: size: 23752824, object count: 
> 22964, class count: 519, roots: 8074
>               Bytes      Count  Average Class name
>            17182136       1117    15382 System.Byte[] (bytes: +16703432, 
> count: +509)
>                  555 root references (2 pinning)
>                  18 references from: SBSSHClient.TElSSHClient
>                  14 references from: 
> SBCryptoProvBuiltInSym.TElBuiltInAESSymmetricCrypto
>                  13 references from: SBSSHKeyStorage.TElSSHKey
> Sorry that you have to spell it out in wet cardboard, but what is a root 
> reference and what does pinning mean?

Typically, a root reference is a static field in a class, or a gc
handle (see the GCHandle docs on msdn). Pinning means that two
of those arrays were referenced either from a pinning gc handle
or from some pinning variable on one of the thread's stacks
(because of something like the fixed C# statement or by the
conservative GC scan of some other stack local variable).
Pinning means also that the object can't be moved in memory.

Given the high number of root references to the arrays, my guess
is that the app creates GC handles for them and doesn't free them.
In the GC summary you should see something like the following if my
guess is true:

	GC handles normal: created: 600, destroyed: 0, max: 600


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-list mailing list