View previous topic :: View next topic |
Author |
Message |
Erlend Guru
Joined: 26 Dec 2004 Posts: 493
|
Posted: Tue Aug 12, 2008 1:00 pm Post subject: Some process keeps using 100% of the RAM and swap! |
|
|
This occassionally happens, and it is very, very annoying. Basically my system "freezes" because all the RAM and swap get used (I know because of the Xfce system monitor in the panel). The hard grinds and the mouse cursor will basically not move. I've also tried ssh'ing in to run top - but no response. The system hasn't actually crashed, it's just going soo slow as to be unusable.
I have 2GB of RAM, and 1.5GB of swap.
I really don't want this to happen again, as the only way out of it is to restart. I want to find out which process is doing it (I run quite a lot: from eclipse, to compiz, firefox, thunderbird, amarok, pidgin, skype) and stop processes from doing it again.
1. I'm thinking of having a two minute cron job which spits the name of the highest memory process to a file, to try and find out who is doing it.
2. I know about ulimit, can I safely use it to stop processes from allocating too much memory?
I find that fact that a single, user-level process is able to essentially crash a system by taking all the RAM and swap slightly concerning.
Thanks,
Erlend _________________ Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/ |
|
Back to top |
|
|
jmz2 Guru
Joined: 13 Jan 2004 Posts: 421 Location: Finland
|
Posted: Tue Aug 12, 2008 2:46 pm Post subject: |
|
|
Use conky. With it you can see the process taking the most memory in real time |
|
Back to top |
|
|
phajdan.jr Retired Dev
Joined: 23 Mar 2006 Posts: 1777 Location: Poland
|
Posted: Tue Aug 12, 2008 2:52 pm Post subject: Re: Some process keeps using 100% of the RAM and swap! |
|
|
Erlend wrote: |
1. I'm thinking of having a two minute cron job which spits the name of the highest memory process to a file, to try and find out who is doing it.
|
Sounds reasonable, but depending on how fast the freeze happens since you can notice first symptoms, you may want to probe more frequently (even a simple loop in bash using sleep should be sufficient).
Erlend wrote: | 2. I know about ulimit, can I safely use it to stop processes from allocating too much memory?
I find that fact that a single, user-level process is able to essentially crash a system by taking all the RAM and swap slightly concerning. |
ulimit should help. Are you sure it's one process, and not many processes constantly forking? The latter is much more dangerous (yet limiting number of processes is a remedy), while in former case the process should get killed, sooner or later. |
|
Back to top |
|
|
Erlend Guru
Joined: 26 Dec 2004 Posts: 493
|
Posted: Tue Aug 12, 2008 3:57 pm Post subject: Re: Some process keeps using 100% of the RAM and swap! |
|
|
Quote: |
Use conky. With it you can see the process taking the most memory in real time
|
Only if conky is the top-most window... and once the "crash" has happened I can't switch windows.
_ph wrote: |
Erlend wrote: | 2. I know about ulimit, can I safely use it to stop processes from allocating too much memory?
I find that fact that a single, user-level process is able to essentially crash a system by taking all the RAM and swap slightly concerning. |
ulimit should help. Are you sure it's one process, and not many processes constantly forking? The latter is much more dangerous (yet limiting number of processes is a remedy), while in former case the process should get killed, sooner or later. |
I'm not sure what it is at all: it could be something in the kernel for all I know! Is it possible to limit the number of child processes? _________________ Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/ |
|
Back to top |
|
|
phajdan.jr Retired Dev
Joined: 23 Mar 2006 Posts: 1777 Location: Poland
|
Posted: Tue Aug 12, 2008 4:01 pm Post subject: Re: Some process keeps using 100% of the RAM and swap! |
|
|
Erlend wrote: | I'm not sure what it is at all: it could be something in the kernel for all I know! Is it possible to limit the number of child processes? |
I'm not sure. It certainly is possible to limit number of processes per user. Please try first to gather as much information about your issue as you can, then our answers could be more specific. |
|
Back to top |
|
|
Erlend Guru
Joined: 26 Dec 2004 Posts: 493
|
Posted: Tue Aug 12, 2008 4:09 pm Post subject: Re: Some process keeps using 100% of the RAM and swap! |
|
|
_ph wrote: | Please try first to gather as much information about your issue as you can, then our answers could be more specific. |
That's specifically what I'm having trouble doing: the crash happens so seldom (once a month?) that it will take ages to build up statistics on what I was doing when it happened. _________________ Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/ |
|
Back to top |
|
|
rangerguy39 n00b
Joined: 18 Jul 2008 Posts: 43
|
Posted: Tue Aug 12, 2008 4:19 pm Post subject: |
|
|
I have this same problem, happened a few times a day. Uninstalling compiz seems to have fixed it. |
|
Back to top |
|
|
Aries-Belgium l33t
Joined: 08 Jul 2005 Posts: 730 Location: Willebroek, Belgium
|
Posted: Wed Sep 10, 2008 12:16 pm Post subject: |
|
|
I'm having the same problem and it's bugging me out :S
When I'm just running Firefox and Eclipse for a few hours my system gets really slow. I'm running on 1GB or RAM and I know it's probably a good idea to upgrade but now I see that people with 2GB are having the same problems. I'm not running compiz or other fancy things. Before upgrading my system with more memory and a faster processor I would really like to know what the problem is. _________________ Ep2.nl | Developers Community |
|
Back to top |
|
|
farhaven Tux's lil' helper
Joined: 17 Feb 2008 Posts: 127
|
Posted: Wed Sep 10, 2008 1:32 pm Post subject: |
|
|
If you have another PC, you could use that one to ssh into your box and start top. That way, you can work without being disturbed and you can see the offender once the system grinds to halt. |
|
Back to top |
|
|
Erlend Guru
Joined: 26 Dec 2004 Posts: 493
|
Posted: Sun Sep 14, 2008 9:24 am Post subject: |
|
|
farhaven wrote: | If you have another PC, you could use that one to ssh into your box and start top. That way, you can work without being disturbed and you can see the offender once the system grinds to halt. |
Already tried that. The machine won't connect. Whichever process is using 100% CPU is filling the memory up to, so that my computer spends all it's time swapping to/from disk. _________________ Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/ |
|
Back to top |
|
|
Paapaa l33t
Joined: 14 Aug 2005 Posts: 955 Location: Finland
|
Posted: Sun Sep 14, 2008 10:46 am Post subject: |
|
|
For me the memory leak is caused by Firefox+acroread doing something nasty. This is a amd64 installation with 64-bit firefox. _________________ Paludis, the way packages are meant to be managed. |
|
Back to top |
|
|
|