How to set heap size and GC method (to G1)
wildflower108 Jun 25, 2018 6:48 AM- I am trying to do two things:
- 1)Change GC to G1
- 2)Change default to use Large Memory Pages
- I am running JBoss 7 in standalone mode, this is what I did:
- #more standalone.conf
- ***snip***
- #
- # Specify options to pass to the Java VM.
- #
- if [ "x$JAVA_OPTS" = "x" ]; then
- JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true" XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
- JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
- else
- echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
- fi
- ***snip***
- I restarted standalone.sh but it appears that the values are not being picked up, see below:
- [root@localhost bin]# ps -ef | grep java
- root 7895 7846 1 08:36 pts/1 00:00:19 /usr/lib/jvm/java-1.8.0-openjdk/bin/java -D[Standalone] -server -verbose:gc -Xloggc:/opt/jboss-eap-7.1/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/jboss-eap-7.1/standalone/log/server.log -Dlogging.configuration=file:/opt/jboss-eap-7.1/standalone/configuration/logging.properties -jar /opt/jboss-eap-7.1/jboss-modules.jar -mp /opt/jboss-eap-7.1/modules org.jboss.as.standalone -Djboss.home.dir=/opt/jboss-eap-7.1 -Djboss.server.base.dir=/opt/jboss-eap-7.1/standalone
- [root@localhost bin]# java -XX:+PrintCommandLineFlags -version
- -XX:InitialHeapSize=46999552 -XX:MaxHeapSize=751992832 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
- openjdk version "1.8.0_171"
- OpenJDK Runtime Environment (build 1.8.0_171-b10)
- OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
- Is default heap size different from Jboss jvm heap size?
- Where can I change the default heap size?
- Where can I manage the standalone JVM heap size?
- How do I set GC to type G1
- How to enable large memory pages