| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Fri Nov 14, 2008 5:44 am Post subject: How can i find out how much memory is used. |
|
|
I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this? |
|
| |
|
Back to top |
Nate Eldredge Guest
|
Posted: Fri Nov 14, 2008 8:52 am Post subject: Re: How can i find out how much memory is used. |
|
|
scholz.lothar@gmail.com writes:
| Quote: | I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
|
man proc
The various fields of /proc/[pid]/statm should have what you want, once
you decide exactly what you mean by "how much memory is used". |
|
| |
|
Back to top |
Jasen Betts Guest
|
Posted: Fri Nov 14, 2008 3:04 pm Post subject: Re: How can i find out how much memory is used. |
|
|
On 2008-11-14, scholz.lothar@gmail.com <scholz.lothar@gmail.com> wrote:
| Quote: | I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
|
best way is to use well behaved software in the first place,
otherwise you can look in /proc/%d/status
where %d is replaced with the PID. |
|
| |
|
Back to top |
David Schwartz Guest
|
Posted: Fri Nov 14, 2008 5:39 pm Post subject: Re: How can i find out how much memory is used. |
|
|
On Nov 13, 9:44 pm, scholz.lot...@gmail.com wrote:
| Quote: | I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
|
Virtual memory or physical memory?
DS |
|
| |
|
Back to top |
Guest
|
Posted: Wed Nov 19, 2008 10:36 am Post subject: Re: How can i find out how much memory is used. |
|
|
On 14 Nov., 18:39, David Schwartz <dav...@webmaster.com> wrote:
| Quote: | On Nov 13, 9:44 pm, scholz.lot...@gmail.com wrote:
I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
Virtual memory or physical memory?
|
Physical memory, not adress space.
I want to write an application server for very low memory virtual
servers (~100 MByte total RAM)
and without swap space. |
|
| |
|
Back to top |
David Schwartz Guest
|
Posted: Wed Nov 19, 2008 6:45 pm Post subject: Re: How can i find out how much memory is used. |
|
|
On Nov 19, 2:36 am, scholz.lot...@gmail.com wrote:
| Quote: | I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
Virtual memory or physical memory?
Physical memory, not adress space.
I want to write an application server for very low memory virtual
servers (~100 MByte total RAM)
and without swap space.
|
Then 'ps' will tell you what you want. The 'RSS' column will tell you
how much physical memory it's using.
DS |
|
| |
|
Back to top |
Jasen Betts Guest
|
Posted: Thu Nov 20, 2008 9:07 am Post subject: Re: How can i find out how much memory is used. |
|
|
On 2008-11-19, scholz.lothar@gmail.com <scholz.lothar@gmail.com> wrote:
| Quote: | On 14 Nov., 18:39, David Schwartz <dav...@webmaster.com> wrote:
On Nov 13, 9:44Â pm, scholz.lot...@gmail.com wrote:
I'm writting an application server and need a fast way to check how
much memory by a process is used and do an emergency stop (aka
terminate) if the process is running wild.
Whats the best way to do this?
Virtual memory or physical memory?
Physical memory, not adress space.
I want to write an application server for very low memory virtual
servers (~100 MByte total RAM)
and without swap space.
|
why not let the kernel do it for you using the setrlimit call? |
|
| |
|
Back to top |
|