Get Memory Usage of my Program

A

Andreas Kammann

Hi , how can i get the current memory usage of my program (like the memory
usage of the task manager )
greetings
 
T

TP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top