Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Recently I've been getting a rather annoying problem, which seems to be linked to Firefox-Trunk, Thunderbird-Trunk, or possible Compiz (default 12.04 compiz with Unity). At random (it seems) the system becomes unusable because the RAM is suddenly full.

I thought it was a Firefox only problem (with Google+ - if you scroll it was doing this), but further investigation revealed other potential causes. I've since disabled all addons and the problem has not yet occured (at the time of writing) - but I'm waiting to see - because I had to start KDM just to log in (Lightdm freezes now thanks to having to kill the xserver twice).

Preramble aside - is there a way that I can track what process is going out of hand (maybe by a log?) so I can fix it later?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Preramble aside - is there a way that I can track what process is going out of hand (maybe by a log?) so I can fix it later?

If you suspect it's a specific process, just start it from within a bash script, calling ulimit -v N first, where N is the max virtual memory in kilobytes you want to give it before the kernel kills it. You'll know what it is when it dies ;)

You could also try setting a simple cron job which appends the output of ps with specific parameters (for memory) to a log every minute and parse later.

Finally, try monit (in repos), which monitors processes and can take actions such as killing, restarting, etc. when specific thresholds are exceeded.

share|improve this answer
    
This covers my criteria exactly, thanks! –  RolandiXor May 21 '12 at 0:50
    
P.S. Can you write an example of how to correctly use ulimit to launch the process with a limit? Also an example of how to use monit would be nice :) –  RolandiXor May 22 '12 at 5:04
    
Will do in the next 2-3 days. Please feel free to remind with a comment (they can be deleted later) if I have forgotten! :) –  izx May 23 '12 at 6:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.