Chris Lyon's WebLog

Or How I Learned To Stop Worrying And Love The GC

Browse by Tags

Tagged Content List
  • Blog Post: WeakReferences And Tracking Resurrection

    The WeakReference class has two public constructors. public WeakReference(Object target) public WeakReference(Object target, bool trackResurrection) The first parameter is pretty obvious. It’s the object you want the WeakReference to reference, without keeping the object alive. If a WeakReference...
  • Blog Post: Why You Shouldn’t Rely On WeakReference.IsAlive

    The WeakReference class has the property IsAlive. The problem with it, is that you can only trust it if it returns false. While a WeakReference points to an object that is either live (reachable), or garbage (unreachable) that has not yet been collected by the GC, the IsAlive property will return...
Page 1 of 1 (2 items)