We have 4GB on our linux server but we can currently use only ~1.8GB for our java-server, which is the first java process listed below. (200 MB are free so we can maximal use 1.6GB + 0.2GB)
The machine crashes when we are using more. So we specified -Xmx1600m and -XX:MaxPermSize=200m to limit the server RAM to 1.8GB. But we need more RAM! Where is the remaining RAM gone?
Here is the program output of top sorted against memory usage (via big 'M'):
Mem: 4083952k total, 3857856k used, 226096k free, 169320k buffers Swap: 2104504k total, 176k used, 2104328k free, 1939080k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 28155 root 16 0 1835m 1.6g 7848 S 2 40.5 47:36.26 java 19609 root 16 0 45996 7052 3148 S 0 0.2 14:35.97 httpd2-prefork 6802 root 16 0 46132 5916 1932 S 0 0.1 0:00.09 httpd2-prefork 6866 root 15 0 46132 5916 1932 S 0 0.1 0:00.07 httpd2-prefork
As you can see there are a lot (and even more) httpd2-prefork processes. But even if I accumulate the bytes (25* ~46KB = ~1MB) it will never get that big.
free -m prints:
total used free shared buffers cached Mem: 3988 3768 219 0 165 1894 -/+ buffers/cache: 1708 2279 Swap: 2055 0 2055
Where is my mistake? Can I tune the server to give the java process more RAM?
BTW: we are not using a virtual machine like here
As it was pointed out in the comments: it is a 32bit kernel only :-( (via uname -a). So I can use only 3GB at least? But the server itself seems to be 64 bit? Because of the lm (long mode) in the output?
grep flags /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr ...
Here is another very similar question.