Returns the current generation number of the specified object.
using System; class MainClass { static void Main() { MainClass myGCCol = new MainClass(); Console.WriteLine("The highest generation is {0}", GC.MaxGeneration); Console.WriteLine("Generation: {0}", GC.GetGeneration(myGCCol)); } }