0 Replies Latest reply on Jun 25, 2018 6:48 AM by Shankar Hariharan

    How to set heap size and GC method (to G1)

    Shankar Hariharan Newbie
      1. I am trying to do two things:
      2. 1)Change GC to G1
      3. 2)Change default to use Large Memory Pages
      4. I am running JBoss 7 in standalone mode, this is what I did:
      5. #more standalone.conf
      6. ***snip***
      7. #
      8. # Specify options to pass to the Java VM.
      9. #
      10. if [ "x$JAVA_OPTS" = "x" ]; then
      11.    JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true" XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
      12.    JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
      13. else
      14.    echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
      15. fi
      16. ***snip***
      17. I restarted standalone.sh but it appears that the values are not being picked up, see below:
      18. [root@localhost bin]# ps -ef | grep java
      19. 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
      20. [root@localhost bin]# java -XX:+PrintCommandLineFlags -version
      21. -XX:InitialHeapSize=46999552 -XX:MaxHeapSize=751992832 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
      22. openjdk version "1.8.0_171"
      23. OpenJDK Runtime Environment (build 1.8.0_171-b10)
      24. OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
      25. Is  default heap size different from Jboss jvm heap size?
      26. Where can I change the default heap size?
      27. Where can I manage the standalone JVM heap size?
      28. How do I set GC to type G1
      29. How to enable large memory pages