5

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.

Duijf
  • 689
SpyrosP
  • 51

1 Answers1

1

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

Waxhead
  • 1,300