I got a new VPS to run some java programs that me and some buddies have made. I start the process with a line like this:
java -Xmx512M -jar program.jar
On our old VPS, you could use the 'top' command to see how much virtual and resident memory was being used. It would use like 600-700mb of virtual memory. Now on our new VPS, with that same command, the virtual memory seems to always be an extra ~2gb over the -Xmx value. So instead of the virtual memory being around 600-700mb, it's instead 2700-3000mb.
The old VPS is running CentOS 5.7 and the new is running CentOS 6.2. Both are running JRE 1.7u3 64bit.
Why is this and how can I fix it?
edit: top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27645 pyro 20 0 3003m 270m 10m S 5.0 1.7 1:19.18 java -Xmx512M -jar cserver.jar
another edit: I am not questioning why virtual memory is using more memory than specified in the java command line. I am questioning why it is using so much more than it used to.