Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Memory usage of each process

Status
Not open for further replies.

chrissie1

Programmer
Aug 12, 2002
4,517
BE
I know this question has been asked on this forum before. Mostly without an answer.
But now I got the answer.

Code:
Dim p As Process
For Each p In p.GetProcesses
  lblMemUsage.Text = p.ToString.Remove(0, 27).ToLower & " " & (p.WorkingSet / 1024).ToString("0,000") & " K"
Next

And I'll make it into a FAQ.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Rock on Chrisie! We will be looking at some optimization in the next few weeks, that code will come in helpful!

-Rick

----------------------
 
Well I have to say, the person that came up with the name of that property should be shot. Come on Workingset?? I tried all the ones with memory or age in them, needles to say without the desired result and then tried all the others beginning with A. Yes W is at the end of the alphabet.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Working set is the amount of memory used by a process. It's an operating system term.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top