Garbage collection type : GC : Development C# Examples


C# Examples » Development » GC »

 

Garbage collection type









    
using  System;
using  System.Collections.Generic;
using  System.Globalization;
using  System.IO;
using  System.Text;
using  System.Security.Cryptography;

public  class  MainClass
{
        public  static  void  Main()
        {
                Console.WriteLine("TotalMemory:  {0}",  GC.GetTotalMemory(false));
                Console.WriteLine("(forcing  a  GC...)");
                GC.Collect();
                Console.WriteLine("TotalMemory:  {0}",  GC.GetTotalMemory(false));
        }
}
    
   
  
   



Output

TotalMemory: 141036
(forcing a GC...)
TotalMemory: 153444


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» GC