By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

Kill process when memory usage reaches upto 80%

P: n/a
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

Dec 7 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Sehboo wrote:
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?

Dec 7 '05 #2

P: n/a
We don't have code for that process

Chris Dunaway wrote:
Sehboo wrote:
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?


Dec 8 '05 #3

P: n/a
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.

Dec 8 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.