Check WeakReference Checksum

I know that if the object had no reference and the GC cleared it, the WeakReference.Target object property will return null.

But suppose the object does not have a strong link, but the GC has not cleared it yet, is there anyway to check its WeakReference, does it have any strong links?

+3
source share
1 answer

No - this is determined by whether the GC object has a root. GC does not detect this until it starts.

Take a look at this MSDN magazine article ( Part One and Part Two ) for more information on GC in .Net.

** Update ** Thanks @Adriano for the link to part 2.

+5
source

All Articles