Background:
I have a set of working java components that I run as part of my webapp. I am developing locally on Ubuntu 10.10 and deploying the Ubuntu 10.04LTS server (media temple instance (ve)).
They both work with one the JVM: Sun JVM 1.6.0_22-b04. As part of the script initialization, each worker starts with explicit settings Xmx, Xmsand XX:MaxPermGen.
But somehow, locally, all 10 workers use 250 MB, and on the server they use more than 2.7 GB.
I do not know how to start tracking this. I thought that the version of Ubuntu (and therefore the kernel) might matter, but I tried the old 10.04 VM and it behaves as expected.
I noticed that the machine never seems to use memory for the buffer or cache (according to htop), which seems a bit strange, but maybe normal for the server?
(edited) Some information:
(server)
root@devel:/app/axir/target
Linux devel 2.6.18-028stab069.5
(local)
wiktor@beastie:~$ uname -a
Linux beastie 2.6.35-25-generic
(edited) Comparison of PS output: ( ps -eo "ppid,pid,cmd,rss,sz,vsz")
PPID PID CMD RSS SZ VSZ
(local)
1588 1615 java -cp axir-distribution. 25484 234382 937528
1615 1631 java -cp /home/wiktor/Code/ 83472 163059 652236
1615 1657 java -cp /home/wiktor/Code/ 70624 89135 356540
1615 1658 java -cp /home/wiktor/Code/ 37652 77625 310500
1615 1669 java -cp /home/wiktor/Code/ 38096 77733 310932
1615 1675 java -cp /home/wiktor/Code/ 37420 61395 245580
1615 1684 java -cp /home/wiktor/Code/ 38000 77736 310944
1615 1703 java -cp /home/wiktor/Code/ 39180 78060 312240
1615 1712 java -cp /home/wiktor/Code/ 38488 93882 375528
1615 1719 java -cp /home/wiktor/Code/ 38312 77874 311496
1615 1726 java -cp /home/wiktor/Code/ 38656 77958 311832
1615 1727 java -cp /home/wiktor/Code/ 78016 89429 357716
(server)
22522 23560 java -cp axir-distribution. 24860 285196 1140784
23560 23585 java -cp /app/axir/target/a 100764 161629 646516
23560 23667 java -cp /app/axir/target/a 72408 92682 370728
23560 23670 java -cp /app/axir/target/a 39948 97671 390684
23560 23674 java -cp /app/axir/target/a 40140 81586 326344
23560 23739 java -cp /app/axir/target/a 39688 81542 326168
They look very similar. In fact, now the question is why, if I add the use of virtual memory on the server (3.2 GB), it more accurately reflects 2.4 GB of used memory (according to free), however the locally used virtual memory adds up to a significantly more significant 4.7 GB but only actually uses ~ 250MB. It seems that memory is not shared so aggressively. (if possible)
Thank you for your help.
Wiktor