I understand that dump and gcroot are not correct

My understanding is that the dumpheap command lists all the object present on the .NET heap that is not garbage collected. In this case, if I run gcroot against the address of an object (found via! Dumpheap -mt XXX), it should always give me a stack trace where this object is referenced. However, I find examples where I cannot find the root of the objects listed in! Dumpheap. My understanding oh! Dumpheap and! Gcroot is not correct? If you want to see the examples described in my other question please post here

+3


source to share


1 answer


!dumpheap

lists all objects in the managed heap. Some of them may be GC eligible (i.e. they are not injected). The latest version of SOS has flags -live

and -dead

to specifically list objects that may or may not be recovered at this point.

Likewise, it !dumpheap

also lists "free" objects, which are areas of the managed heap that have not yet been compacted. Output example:



73113f80        1           84 System.Exception
008c4cb8        8           96      Free                <--- can be compacted at some point
731142a8        1          112 System.AppDomain
731169a4        1          132 System.Globalization.NumberFormatInfo
731162dc        2          144 System.Globalization.CultureInfo
731141a0        2          168 System.Threading.ThreadAbortException
73116d54        2          280 System.Byte[]
73117684        3          468     System.Collections.Generic.Dictionary`2+Entry[[System.Type, mscorlib],    [System.Security.Policy.EvidenceTypeDescriptor, mscorlib]][]
731155f4       11          564 System.Int32[]
73116518        2          616 System.Globalization.CultureData
731147f8        4          718 System.Char[]
73115020       26          728 System.RuntimeType
73113e38      164         5502 System.String
730d0cdc       26        18152 System.Object[]

      

+5


source







All Articles