Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
4.20/5 (3 votes)
See more:
To let me explain why I need to know, in my server launcher (for a game) someone requested that I added a 'Restart on Excessive Memory Usage' checkbox. So, after an hour or so of adventuring, I came here.

I just need to know how to read the memory usage of a running application and I can do the rest. I just have no idea how to do this withing a c# application.

What I have so far is

C#
Process[] p = System.Diagnostics.Process.GetProcessesByName("ProcessName");


Then I need to get the WorkingSet, but I can't do this as it's an array. Is there anyway to fix this?

Thank you!
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900