How to increase heap memory for WildFly?

JavaPerformanceWildflyHeap Memory

Java Problem Overview


WildFly 8 is started on a linux server with standalone.sh. I noticed that the server was started with very few heap memory space.

I need to increase the heap memory space for the server and for applications, which are running on the server. How can I do it?

Java Solutions


Solution 1 - Java

Just edit bin/standalone.conf, look for the first occurrence of JAVA_OPTS and change the -Xmx option according to your needs.

Solution 2 - Java

Linux:

bin/standalone.conf

Check for the following line,

JAVA_OPTS

and change it accordingly to suit your heap size needs

-Xms1303m: initial heap size in megabytes
-Xmx1303m: maximum heap size in megabytes

JAVA_OPTS="-Xms1024M -Xmx2048M -XX:MaxPermSize=2048M -XX:MaxHeapSize=2048M"

Windows:

bin/standalone.conf.bat

JAVA_OPTS="-Xms1024M -Xmx2048M -XX:MaxPermSize=2048M -XX:MaxHeapSize=2048M"

Now restart the server and it will work without prompting any heap size errors.

Solution 3 - Java

On OS WINDOWS you need to setting standalone.conf.bat

Solution 4 - Java

if wildfly 8 is used along with JDK 8, We need to add MaxMetaSpace Size. For example, JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=256M" As we all know Java 8 does not support Perm gen setting. For related information, Please check Wildfly Heap issue

I hope it helps.

Solution 5 - Java

I am running Eclipse and changing the 'bin/standalone.conf' didn’t work for me. In this case the solution was oppening the 'Servers' view in Eclipse, double-click the Wildfly server, go to 'Open launch configuation' and do that changes there in 'VM argumments'. Anyway I am a bit noob with Wildfly, I hope other users could contrast my info, I found that in http://www.nailedtothex.org/roller/kyle/entry/articles-wildfly-jvmparams

Its for a Linux server, but I think it could work for windows too.

Solution 6 - Java

For managed domain you can set it using heap tag (e.g.<heap size="64m" max-size="512m"/>) within jvm in domain.xml or host.xml (depending on the scope you want to address).

Solution 7 - Java

Answer from official documentation:

> For a standalone server, you have to pass in the JVM settings either > as command line arguments when executing the > $JBOSS_HOME/bin/standalone.sh script, or by declaring them in > $JBOSS_HOME/bin/standalone.conf. (For Windows users, the script to > execute is %JBOSS_HOME%/bin/standalone.bat while the JVM settings can > be declared in %JBOSS_HOME%/bin/standalone.conf.bat)

** Restart server to make this change effective.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionManuelaView Question on Stackoverflow
Solution 1 - JavaHarald WellmannView Answer on Stackoverflow
Solution 2 - JavaDu-LacosteView Answer on Stackoverflow
Solution 3 - JavaHettView Answer on Stackoverflow
Solution 4 - JavasatishView Answer on Stackoverflow
Solution 5 - JavaScutariusView Answer on Stackoverflow
Solution 6 - JavaTomSView Answer on Stackoverflow
Solution 7 - JavaSaikatView Answer on Stackoverflow