title: Recommended Heap Configuration
body: <p>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.</p>
  
  <p>Wildfly conf:</p>
  
  <p>bin/standalone.conf</p>
  
  <pre><code>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  
  </code></pre>
  
  <p>domain/configuration/domain.xml</p>
  
  <pre><code>&lt;server-group name="main-server-group" profile="full"&gt;  
              &lt;jvm name="default"&gt;  
                  &lt;heap size="1024m" max-size="1536m"/&gt;  
              &lt;/jvm&gt;  
              &lt;socket-binding-group ref="full-sockets"/&gt;  
          &lt;/server-group&gt;  
          &lt;server-group name="other-server-group" profile="full-ha"&gt;  
              &lt;jvm name="default"&gt;  
                  &lt;heap size="1024m" max-size="1536m"/&gt;  
              &lt;/jvm&gt;  
              &lt;socket-binding-group ref="full-ha-sockets"/&gt;  
  &lt;/server-group&gt;  
  </code></pre>
  
  <p>domain/configuration/host.xml</p>
  
  <pre><code>&lt;jvms&gt;  
          &lt;jvm name="default"&gt;  
              &lt;heap size="1024m" max-size="1536m"/&gt;  
              &lt;jvm-options&gt;  
                  &lt;option value="-server"/&gt;  
                  &lt;option value="-XX:MetaspaceSize=96m"/&gt;  
                  &lt;option value="-XX:MaxMetaspaceSize=256m"/&gt;  
                  &lt;option value="--add-exports=java.base/sun.nio.ch=ALL-UNNAMED"/&gt;  
              &lt;/jvm-options&gt;  
          &lt;/jvm&gt;  
      &lt;/jvms&gt;  
  </code></pre>
  
  <p>Thank you.</p>