How is the privvmpages limit reached? [message #27101] |
Sat, 09 February 2008 12:45 |
Wheel
Messages: 3 Registered: February 2008
|
Junior Member |
|
|
I trying to run Java (memory allocation intensive) on a VPS, and getting privvmpages limit problems.
I know that increasing privvmpages limit, using Xen, or decreasing the Java XMX usage, will fix the problem. But I'm wondering why and how Java reaches this privvmpages limit.
I have two VPSes:
XEN VPS:
-256mb guaranteed
-512mb swap
-No memory problems
[root@vps proc]#ps -aux --sort -vsize
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
tomcat 18099 0.2 26.9 236172 70580 ? Sl Feb08 3:39 jsvc.exec -user tomcat -home /usr/java/default -Dcatalina.home=/opt/tomcat -Dcatalina.base=/opt/
tomcat 23131 27.7 16.9 222084 44592 pts/2 Sl+ 10:19 0:09 /usr/java/default/bin/java -classpath /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/
tomcat 23091 25.4 17.0 221920 44692 pts/0 Sl+ 10:19 0:09 /usr/java/default/bin/java -classpath /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/
tomcat 23306 56.9 16.7 220756 44052 pts/1 Sl+ 10:19 0:08 /usr/java/default/bin/java -classpath /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/
mysql 18071 0.4 12.3 147652 32312 ? Sl Feb08 6:30 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=m
............
[root@vps proc]#free
total used free shared buffers cached
Mem: 262312 259472 2840 0 1216 35272
-/+ buffers/cache: 222984 39328
Swap: 525304 2772 522532
OpenVZ VPS:
-384MB guaranteerd
- ~800MB privvmpages/burst?
-Memory problems when using the same apps as the XEN vps.
[root@vps ]# ant -f build-run-linux.xml
Error occurred during initialization of VM
Could not reserve enough space for code cache
[root@vps proc]# ps -aux --sort -vsize
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
tomcat 17460 0.3 6.1 203984 48340 ? Sl 01:44 0:06 jsvc.exec -user tomcat -home /usr/java/default -Dcatalina.home=/opt/tomcat -Dcatalina.base=/opt/tomcat -Djava.io.tmpdir=/var/tmp -w
root 23818 71.3 5.0 193520 39484 pts/1 Sl+ 02:14 0:04 /usr/java/latest/jre/bin/java -classpath /usr/share/ant/lib/ant-launcher.jar -Dant.home=/usr/share/ant -Dant.library.dir=/usr/share
root 23808 56.0 5.0 193348 40052 pts/0 Sl+ 02:14 0:04 /usr/java/latest/jre/bin/java -classpath /usr/share/ant/lib/ant-launcher.jar -Dant.home=/usr/share/ant -Dant.library.dir=/usr/share
mysql 16196 0.1 3.8 143256 30148 pts/0 Sl 01:41 0:02 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mys
.......
[root@vps proc]# cat user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
982850: kmemsize 7287695 7764715 2147483646 2147483646 0
lockedpages 0 0 999999 999999 0
privvmpages 188389 191204 196608 196608 3
shmpages 3885 3901 98304 98304 0
dummy 0 0 0 0 0
numproc 109 113 999999 999999 0
physpages 40864 43050 0 2147483647 0
vmguarpages 0 0 98304 2147483647 0
oomguarpages 40864 43050 98304 2147483647 0
numtcpsock 62 67 7999992 7999992 0
numflock 6 11 999999 999999 0
numpty 4 4 500000 500000 0
numsiginfo 0 2 999999 999999 0
tcpsndbuf 1292928 1334288 80530432 262556672 0
tcprcvbuf 1249536 1371040 80530432 262556672 0
othersockbuf 13920 32896 80530432 262556672 0
dgramrcvbuf 0 8464 80530432 262556672 0
numothersock 18 24 7999992 7999992 0
dcachesize 0 0 2147483646 2147483646 0
numfile 2571 2638 23999976 23999976 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 14 14 999999 999999 0
[root@vps proc]# free
total used free shared buffers cached
Mem: 786432 755120 31312 0 0 0
-/+ buffers/cache: 755120 31312
Swap: 0 0 0
As can be seen above, the XEN vps with less memory than the OpenVZ vps, did not cause any memory probems, while the OpenVZ vps with more total (inc burst) memory did cause memory problems by hitting privvmpages.
I read on a number of different sites that hitting privvmpages is caused by OpenVZ showing the total ammount of RAM on the hardware machine/Host instead of the amount of RAM on the VPS.
Someone said to me "OpenVZ does offer SLM like propoerties in reporting RAM so you should be ok with day to day usage of it rather than the old method where is reported the RAM of the host".
And the "free" command also shows a total RAM of the VPS and not that of the host.
My question is:
1) Why is the OpenVZ having memory problems while it has more memory than the Xen VPS?
2) Is the statement correct that Java sees [as total ram] the amount of the VPS (~800mb) and not that of the host?
|
|
|