Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some process keeps using 100% of the RAM and swap!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 493

PostPosted: Tue Aug 12, 2008 1:00 pm    Post subject: Some process keeps using 100% of the RAM and swap! Reply with quote

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
View user's profile Send private message
jmz2
Guru
Guru


Joined: 13 Jan 2004
Posts: 421
Location: Finland

PostPosted: Tue Aug 12, 2008 2:46 pm    Post subject: Reply with quote

Use conky. With it you can see the process taking the most memory in real time :)
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Tue Aug 12, 2008 2:52 pm    Post subject: Re: Some process keeps using 100% of the RAM and swap! Reply with quote

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
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 493

PostPosted: Tue Aug 12, 2008 3:57 pm    Post subject: Re: Some process keeps using 100% of the RAM and swap! Reply with quote

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
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Tue Aug 12, 2008 4:01 pm    Post subject: Re: Some process keeps using 100% of the RAM and swap! Reply with quote

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
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 493

PostPosted: Tue Aug 12, 2008 4:09 pm    Post subject: Re: Some process keeps using 100% of the RAM and swap! Reply with quote

_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
View user's profile Send private message
rangerguy39
n00b
n00b


Joined: 18 Jul 2008
Posts: 43

PostPosted: Tue Aug 12, 2008 4:19 pm    Post subject: Reply with quote

I have this same problem, happened a few times a day. Uninstalling compiz seems to have fixed it.
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Wed Sep 10, 2008 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
farhaven
Tux's lil' helper
Tux's lil' helper


Joined: 17 Feb 2008
Posts: 127

PostPosted: Wed Sep 10, 2008 1:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 493

PostPosted: Sun Sep 14, 2008 9:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Sun Sep 14, 2008 10:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum