Kill process when memory usage reaches upto 80%

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

    Kill process when memory usage reaches upto 80%

    Hi,

    Is it possible that you can monitor your memory usage and kill some
    process when memory usage reaches 80% or so?

    I have an application which uses lot of memory and then system hangs,
    but it takes about 5 hours before it gets to that point.

    I want to write a monitor app which kills this process and restarts
    when memory is 80% used up.

    Thanks

  • Chris Dunaway

    #2
    Re: Kill process when memory usage reaches upto 80%

    Sehboo wrote:[color=blue]
    > I want to write a monitor app which kills this process and restarts
    > when memory is 80% used up.[/color]

    Why not just fix the problem that is causing the memory to be used up
    instead?

    Comment

    • MasoodAdnan@gmail.com

      #3
      Re: Kill process when memory usage reaches upto 80%

      We don't have code for that process

      Chris Dunaway wrote:[color=blue]
      > Sehboo wrote:[color=green]
      > > I want to write a monitor app which kills this process and restarts
      > > when memory is 80% used up.[/color]
      >
      > Why not just fix the problem that is causing the memory to be used up
      > instead?[/color]

      Comment

      • Chris Dunaway

        #4
        Re: Kill process when memory usage reaches upto 80%

        Bummer. Well, you can use the System.Diagnost ics.Process class and
        call its Kill method to kill a running process. You'd have to use
        GetProcesses or GetProcessByNam e methods to get the Process and then
        call the Kill method.

        Comment

        Working...