473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Dec 7 '05 #1
3 2172
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Peretz | last post by:
I am trying to optimize my C# program, but no matter what I try the application keeps eating memory. I verified all the references and even got special software to count references. I made sure all...
0
by: Ronen | last post by:
Hi All, I am running a client against a web application installed on a remote server written in C# which involve infragistics for GUI . The .NET framework I use is from version 1.1.4322 and we...
2
by: opt_inf_env | last post by:
Hello, Let us suppose that PHP file contains cycle which will never stop. For example: while ( 2==2 ) { some usage of database; } User which opens this PHP page runs time consuming execution...
2
by: Aravind | last post by:
Hi , This is a Windows form application which interacts with the unmanaged C++ codes . In unmanaged c++ code we allocate around 130MB on the heap for annalysing high resolution images . Earlier...
1
by: Ashish | last post by:
hi all we have tested out web site for performance and we observed that the asp.net process does disposes memory ( as opposed to my earlier observation ), i was just curious if the asp.net...
1
by: Michael Tkachev | last post by:
Hi Everybody, I created an Excel file in the ASP.Net. When I wrote this file on the disk I tryed to release COM objects. But I couldn't do it. When my method finished an "Excel" process exists...
22
by: Zen | last post by:
Hi, My production machine has 2G of memory, when aspnet_wp.exe goes up to about ~1.2G of memory usage, I start get out-of-memory exception. Other processes don't use as much memory and I added...
2
by: Macca | last post by:
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...
18
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= | last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for reasons I do not know, a Connect call will totally lock up the thread and never return. I am sure it has something to do...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.