fork download
  1. using System;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. var objeto = new object();
  6. Console.WriteLine($"Geração {GC.GetGeneration(objeto)}");
  7. GC.Collect();
  8. Console.WriteLine($"Geração {GC.GetGeneration(objeto)}");
  9. GC.Collect();
  10. Console.WriteLine($"Geração {GC.GetGeneration(objeto)}");
  11. }
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/201086/101
Success #stdin #stdout 0.02s 15948KB
stdin
Standard input is empty
stdout
Geração 0
Geração 0
Geração 0