GC.GetTotalMemory : GC « System « C# / C Sharp by API






GC.GetTotalMemory

  

using System;
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        Console.WriteLine("Estimated bytes on heap: {0}", GC.GetTotalMemory(false));
        Console.WriteLine("This OS has {0} object generations.\n", (GC.MaxGeneration + 1));
    }
}

   
    
  








Related examples in the same category

1.GC.AddMemoryPressure
2.GC.GetGeneration
3.GC.MaxGeneration
4.GC.RemoveMemoryPressure