I have a Go Daddy Linux VPS, hosting a Java server and a few other things. Evidently we are running out of memory:
[user@xxx ~]$ free -m
total used free shared buffers cached
Mem: 4096 4090 5 0 0 0
-/+ buffers/cache: 4090 5
Swap: 0 0 0
[user@xxx ~]$
But here comes the interesting part. I can't find the memory hog with "ps" - all the listed processes have a "reasonable" memory usage (under 2%), but the system is still out of memory.
Trying to increase the available VM by mounting a swap leads to an error ("Operation not permitted"). I found that this is a limitation of OpenVZ - only the host should swap to disk drives.
The output of "vmstat" is not very useful:
[user@xxx ~]$ vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 5548 0 0 0 0 22 105 0 15 0 1 99 0 0
[user@xxx ~]$
Any ideas how can I find the exact cause of the free memory shortage without blindly killing services and waiting for the problem to repeat? Thanks in advance!