76

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?

Chaminda Bandara
  • 2,067
  • 2
  • 28
  • 31
Manuela
  • 1,379
  • 3
  • 16
  • 25

7 Answers7

116

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

Harald Wellmann
  • 12,615
  • 4
  • 41
  • 63
24

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.

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51
15

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

Hett
  • 3,484
  • 2
  • 34
  • 51
6

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.

satish
  • 1,571
  • 1
  • 11
  • 4
6

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.

Scutarius
  • 61
  • 1
  • 2
5

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).

TomS
  • 1,159
  • 2
  • 17
  • 35
3

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.

Saikat
  • 14,222
  • 20
  • 104
  • 125