GC.GetTotalMemory : GC « System « VB.Net by API






GC.GetTotalMemory

  
 

Module Module1

    Sub Main()

        Console.WriteLine("Starting Heap Space: " & GC.GetTotalMemory(False))

        Dim BigArray(50000) As Byte
        Dim BiggerArray(250000) As Byte

        Console.WriteLine("Heap Space After Arrays: " & GC.GetTotalMemory(False))

        BigArray = Nothing

        Console.WriteLine("Final Heap Space: " & GC.GetTotalMemory(True))

    End Sub

End Module

   
    
  








Related examples in the same category

1.GC.Collect()
2.GC.GetGeneration
3.GC.SuppressFinalize
4.GC.WaitForPendingFinalizers()