System.Diagnostic.Process

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top