Expand Authors Top

If you have a few years of experience in the Java ecosystem and you’d like to share that with the community, have a look at our Contribution Guidelines.

Expanded Audience – Frontegg – Security (partner)
announcement - icon User management is very complex, when implemented properly. No surprise here.

Not having to roll all of that out manually, but instead integrating a mature, fully-fledged solution - yeah, that makes a lot of sense.
That's basically what Frontegg is - User Management for your application. It's focused on making your app scalable, secure and enjoyable for your users.
From signup to authentication, it supports simple scenarios all the way to complex and custom application logic.

Have a look:

>> Elegant User Management, Tailor-made for B2B SaaS

November Discount Launch 2022 – Top
We’re finally running a Black Friday launch. All Courses are 30% off until tomorrow:

>> GET ACCESS NOW

November Discount Launch 2022 – TEMP TOP (NPI)
We’re finally running a Black Friday launch. All Courses are 30% off until tomorrow:

>> GET ACCESS NOW

1. Overview

In this quick tutorial, we'll have a look at how to increase the heap memory size for WildFly.

Naturally, increasing memory size can be useful in order to handle a large number of applications running on the server

2. Using the Startup File

In the standalone mode, we can update the configuration in the startup files to increase the heap memory.

In the WildFly installation home directory, we can find the standalone.conf (for Unix based systems) or standalone.conf.bat (for Windows systems) file in the bin folder.

We can simply open it and update the -Xmx option in the following line (change the number as per the requirement):

JAVA_OPTS="-Xms64m -Xmx512m ..."

This will set the heap memory while starting up the server.

3. Using an Environment Variable

We can also set the default heap memory size by setting the JAVA_OPTS environment variable, which will override the value in the startup file. We can set the environment variable from a command prompt/ terminal.

For Windows:

set JAVA_OPTS=-Xms256m -Xmx1024m ...

For Unix/Linux:

export JAVA_OPTS=-Xms256m -Xmx1024m ...

Once this is set, we can see the result in the logs while starting the WildFly server:

JAVA_OPTS already set in environment; overriding default settings with values ...

4. Conclusion

In this quick tutorial, we found out how to change the heap memory size in WildFly quite easily.

You can explore different popular servers available for Java development in our previous article.

November Discount Launch 2022 – Bottom
We’re finally running a Black Friday launch. All Courses are 30% off until tomorrow:

>> GET ACCESS NOW

Generic footer banner
Comments are closed on this article!