I have multiple servers running CentOS 5.4 and only one application running on Java VM. I've configured the Java VM with the following arguments:
java -Xmx4500M -server -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:NewSize=1024m -Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote=true
The machines I'm running the VM on has 6 GB RAM and no other applications running. After a while, the java process starts to hit the swap space really hard, I get this info out of the
7658 root 25 0 11.7g 3.9g 4796 S 39.4 67.3 543:54.17 java
On the other hand, if I connect via JConsole, it reports the Java VM has 2.6 GB used, 4.6 GB commited and 4.6 Gb max.
java -version returns:
java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
Why is the Java VM expanding so much past it's allocated heap size? And where does that memory go, if it's not reported in JConsole?