Kill process when memory usage reaches upto 80%

  • Thread starter Thread starter Sehboo
  • Start date Start date
S

Sehboo

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
 
Sehboo said:
I want to write a monitor app which kills this process and restarts
when memory is 80% used up.

Why not just fix the problem that is causing the memory to be used up
instead?
 
Bummer. Well, you can use the System.Diagnostics.Process class and
call its Kill method to kill a running process. You'd have to use
GetProcesses or GetProcessByName methods to get the Process and then
call the Kill method.
 

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

Back
Top