Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dedicated server where I've installed apache2, as well as rails-passenger. Although i have 2GBs of RAM and most times about 1,5GB is free, there are some random times where I loose ssh and generic connectivity because oom-killer is killing processes.

I suppose there is a memory leak but I cannot find out where it comes from. oom-killer kills apache2, mysql, passenger and whatever.

Yesterday, I did a cat syslog | grep -c oom-killer and got 57 occurences!

It seems that something seriously destroys the memory. Once I reboot, everything comes back to normal. I suspect that it can be related to passenger, but I'm still trying to figure it out.

Can you think of another cause, or do you have anything to suggest that will make the leak identification procedure easier? I was even thinking of writing a bash script, to be run with cron for like every 5 minutes.

share|improve this question
Yeah, until you run a script pinpointing which processes are growing, when, and how fast, it's not an answerable question. – SilverbackNet Jan 10 '11 at 7:04

The Linux kernel by default overcommit memory so that sometimes a program will successfully allocate memory not available and the OOM will kick in and kill a random process instead. Disabling this would perhaps allow you do perhaps identify what application steals memory. E.g. if a application is suddenly allocating a huge chunk of memory it will fail (and hopefully return a error message). Other applications may fail allocating memory as well so you should watch out for a false positive.

echo 2 > /proc/sys/vm/overcommit_memory

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .