Home All Groups Group Topic Archive Search About

Get Memory Usage of my Program

Author
31 Mar 2006 5:13 PM
Andreas Kammann
Hi , how can i get the current memory usage of my program (like the memory
usage of the task manager )
greetings

Author
31 Mar 2006 11:07 PM
Cerebrus
Hi,

Tim Anderson's IT Writing to the rescue ;-)

Check out this article from the aforementioned resource...

<http://www.itwriting.com/dotnetmem.php>

Regards,

Cerebrus.
Author
2 Apr 2006 3:27 PM
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

Andreas Kammann wrote:
Show quoteHide quote
> Hi , how can i get the current memory usage of my program (like the
> memory usage of the task manager )
> greetings