Introduction
The focus in this article is in the title of the article. It is to show the way to increase the memory allocation or the heap memory allocation for Wildfly Application Server. The process is in the Microsoft Windows-based operating system. This article actually has a connection with the previous article for starting Wildfly Application Server’s service. The article itself exist in this link with the title of ‘How to Start Wildfly Application Server’s service in Microsoft Windows’. The following is the actual execution of the Wildfly Application Server :
C:\wildfly-20.0.1.Final\bin>standalone.bat Calling "C:\wildfly-20.0.1.Final\bin\standalone.conf.bat" Setting JAVA property to "C:\jdk-14\bin\java" =============================================================================== JBoss Bootstrap Environment JBOSS_HOME: "C:\wildfly-20.0.1.Final" JAVA: "C:\jdk-14\bin\java" JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED" =============================================================================== ...
As in the above Wildfly Application Server’s service execution to start, there is an information about the heap memory size. It is currently running with minimum size of 64 M and maximum size of 512 M.
Solution
Generally, according to the output in the introduction part, the allocation for the initialization heap memory is only 64 M. Moreover, the maximum heap size is only 512 M. In that case, in order to increase the size for the heap memory allocation, just change the value. It is the value of the parameter command execution above. It is very simple to do it. Just check the file with the name of ‘standalone.conf.bat’. It exist in the ‘bin’ folder of the root folder of the Wildfly Application Server. For an example, if the root folder of the Wildfly Application Server is in ‘C:\wildfly-20.0.1.Final’, the location for the ‘standalone.conf’ will be in ‘C:\wildfly-20.0.1.Final\bin’. Therefore, the following is the default content of the default value of the heap size allocation in the ‘standalone.conf’ file exist in ‘C:\wildfly-20.0.1.Final\bin’ :
JAVA_OPTS="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m
Basically, the line below is the attempt to change the heap memory size by changing the value of -Xms and -Xmx :
JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m
Finally, after editing the file, just stop and start the Wildfly Application Server again. Soon after, just execute the ‘standalone.bat’ file to start the Wildfly Application Server :
C:\wildfly-20.0.1.Final\bin>standalone.bat Calling "C:\wildfly-20.0.1.Final\bin\standalone.conf.bat" Setting JAVA property to "C:\jdk-14\bin\java" =============================================================================== JBoss Bootstrap Environment JBOSS_HOME: "C:\wildfly-20.0.1.Final" JAVA: "C:\jdk-14\bin\java" JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms1024M -Xmx1024M -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED" ===============================================================================
Actually, there is something different in the execution of the above Wildfly Application Server’s service. The information about the heap memory size is not the same anymore. Currently, it is running with minimum size of 1024 M and maximum size of 1024 M.