2 Replies Latest reply on Apr 28, 2014 4:04 AM by Vladislav Rames

    Jboss EAP 6.2 (Jboss 7.1.1) - how/where can be set -XX:-UseGCOverheadLimit ?

    Vladislav Rames Newbie



      I try to solve "java.lang.OutOfMemoryError: GC overhead limit exceeded" error using "-XX:-UseGCOverheadLimit" option

      in JAVA_OPTS. I have this java version:


      [jboss@jboss-test jboss-as-7.1.1.Final]$ java -version

      java version "1.6.0_28"

      OpenJDK Runtime Environment (IcedTea6 1.13.0pre) (rhel-

      OpenJDK Client VM (build 23.25-b01, mixed mode)


      I've tried to add this option to JAVA_OPTS in domain.conf:




      # Specify options to pass to the Java VM.


      JAVA_OPTS="$JAVA_OPTS -XX:-UseGCOverheadLimit"




      Then I have restarted jboss, I can see this in logfile:




        JBoss Bootstrap Environment


        JBOSS_HOME: /opt/jboss/jboss-as-7.1.1.Final


        JAVA: java


        JAVA_OPTS: -Xms128m -Xmx256m -XX:MaxPermSize=64m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.domain.default.config=domain.xml -Djboss.host.default.config=host.xml -XX:-UseGCOverheadLimit



      But when I try to grep java processes, It hasn't had those option. Where I did a mistake, please?

      Thanks in advance.

        • 1. Re: Jboss EAP 6.2 (Jboss 7.1.1) - how/where can be set -XX:-UseGCOverheadLimit ?
          Wolf-Dieter Fink Master

          I suppose you want to set the Java option for the server processes.

          In this case you need to add it to the <jvm ...> configuration inside the domain.xml or host.xml.

          See for example this doc Domain Setup - JBoss AS 7.1


          The domain.conf is used for the start process i.e. domain/host/process controller, not for the server JVM

          1 of 1 people found this helpful
          • 2. Re: Jboss EAP 6.2 (Jboss 7.1.1) - how/where can be set -XX:-UseGCOverheadLimit ?
            Vladislav Rames Newbie

            Thank you for your post. You are right, I need to set Java option for server JVM.

            I've found only settings "heap size" (~Xms), "heap max size" (~Xmx), "permgen size"

            (~-XX:PermSize) and "max permgen size" (~-XX:MaxPermSize) in documentation

            noticed above. How can I set generic JAVA_OPTS settings for JVM server, please?





            I've found it just now - it's jvm-options tag in host.xml or domain.xml,

            it's described nicely for example in https://docs.newrelic.com/docs/java/jboss-installation-for-java#above-v6-domain.

            So, in my case, I've used this in host.xml:




                    <server name="server-be" group="server-group-be" auto-start="true">

                        <jvm name="jvm-be">

                            <heap size="1024m" max-size="1024m"/>

                            <permgen size="256m" max-size="384m"/>


                                    <option value="-XX:-UseGCOverheadLimit"/>






            It seems it wors properly. Hopefully it can be usefull for somebody.