C# - What is root reference ?

Posted by DotNetGuy on Stack Overflow See other posts from Stack Overflow or by DotNetGuy
Published on 2010-05-01T08:31:43Z Indexed on 2010/05/01 8:37 UTC
Read the original article Hit count: 205

Filed under:
|
class GCTest {
     static Object r1; 

     static void Main() {
         r1 = new Object();
         Object r2 = new Object();
         Object r3 = new Object();
         System.GC.Collect(); // what can be reclaimed here ?

         r1 = null;
         r3.ToString();
         System.GC.Collect(); // what can be reclaimed here ?
     }
    }

// code from - DonBox's Essential .Net

© Stack Overflow or respective owner

Related posts about c#

Related posts about garbage-collection