System.Diagnostic.Process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Macca

    System.Diagnostic.Process

    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.Diagnost ics.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
  • Thomas T. Veldhouse

    #2
    Re: System.Diagnost ic.Process

    Macca <Macca@discussi ons.microsoft.c omwrote:
    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.Diagnost ics.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.Diagnost ics.Process.Get CurrentProcess( ).PagedMemorySi ze

    --
    Thomas T. Veldhouse
    Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1


    Comment

    • Macca

      #3
      Re: System.Diagnost ic.Process

      Hi Thomas,

      what is the difference between :-

      Process.GetCurr entProcess().Pa gedMemorySize;

      Process.GetCurr entProcess().Pr ivateMemorySize ;

      Process.GetCurr entProcess().Pr ivateMemorySize ;


      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

      "Thomas T. Veldhouse" wrote:
      Macca <Macca@discussi ons.microsoft.c omwrote:
      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.Diagnost ics.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.Diagnost ics.Process.Get CurrentProcess( ).PagedMemorySi ze
      >
      --
      Thomas T. Veldhouse
      Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
      >
      >
      >

      Comment

      Working...