System.Diagnostic.Process

G

Guest

Hi,

I would like to get the memory usage of the process my app is running in so
i can monitor levels of memory during runtime. I've been told I can use the
System.Diagnostics.Process class to do this.

I just want the current process my app is running in and not other processes
on the machine. Is there a way the above class can automatcally detect what
process the code is running in?

Thanks
Macca
 
T

Thomas T. Veldhouse

Macca said:
Hi,

I would like to get the memory usage of the process my app is running in so
i can monitor levels of memory during runtime. I've been told I can use the
System.Diagnostics.Process class to do this.

I just want the current process my app is running in and not other processes
on the machine. Is there a way the above class can automatcally detect what
process the code is running in?

Why not?:

System.Diagnostics.Process.GetCurrentProcess().PagedMemorySize
 
G

Guest

Hi Thomas,

what is the difference between :-

Process.GetCurrentProcess().PagedMemorySize;

Process.GetCurrentProcess().PrivateMemorySize;

Process.GetCurrentProcess().PrivateMemorySize;


What is the best method to measure how much memory my process is using. I
want to set a limit on how much memory is it using. If it reaches this limit
I have a cache that i will then empty.

Thanks
Macca
 

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