Get Memory Usage of my Program

  • Thread starter Thread starter Andreas Kammann
  • Start date Start date
A

Andreas Kammann

Hi , how can i get the current memory usage of my program (like the memory
usage of the task manager )
greetings
 
Dim c As Process = Process.GetCurrentProcess()

MessageBox.Show("Mem Usage (Working Set): " & c.WorkingSet / 1024 & " K" & vbCrLf _
& "VM Size (Private Bytes): " & c.PagedMemorySize / 1024 & " K" & vbCrLf _
& "GC TotalMemory: " & GC.GetTotalMemory(True) & " bytes", "Current Memory Usage")

If you would like to retrieve the size of the managed heaps and
other memory info see the PerformanceCounter class in the help.

-TP
 
Back
Top