1 Reply Latest reply on May 7, 2018 7:27 AM by Claudio Miranda

    Recommended Heap Configuration

    Cagdas Caglak Newbie

      Hello,

       

      I can not choose optimal configuration for wildfly as. I have a droplet on DigitalOcean and it has 2GB Ram and 1vCPU. I have a social media application with mongodb(login and see your followers). This app triggers the Firebase Cloud Message service every 15 min. after FCM send notification to clients  and clients send a request to server. After server make some db read/write operations. But the problem is server can not response approximately every 2-3 hours so I need to restart it. I track memory usage graph. after reboot memory usage graph increase slowly but always increase. Is this about wildfly conf or you can say anything about this? There is Nginx front of the Wildfly.


      Wildfly conf:

      bin/standalone.conf

      if [ "x$JAVA_OPTS" = "x" ]; then
         JAVA_OPTS="-Xms768m -Xmx1024m -XX:MetaspaceSize=256M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"
         JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true -Duser.timezone=GMT+3"
      else
         echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
      fi

       

      domain/configuration/domain.xml

      <server-group name="main-server-group" profile="full">
                  <jvm name="default">
                      <heap size="1024m" max-size="1536m"/>
                  </jvm>
                  <socket-binding-group ref="full-sockets"/>
              </server-group>
              <server-group name="other-server-group" profile="full-ha">
                  <jvm name="default">
                      <heap size="1024m" max-size="1536m"/>
                  </jvm>
                  <socket-binding-group ref="full-ha-sockets"/>
      </server-group>
      

       

      domain/configuration/host.xml

      <jvms>
              <jvm name="default">
                  <heap size="1024m" max-size="1536m"/>
                  <jvm-options>
                      <option value="-server"/>
                      <option value="-XX:MetaspaceSize=96m"/>
                      <option value="-XX:MaxMetaspaceSize=256m"/>
                      <option value="--add-exports=java.base/sun.nio.ch=ALL-UNNAMED"/>
                  </jvm-options>
              </jvm>
          </jvms>
      

       

      Thank you.