Improve Performance by Increasing Glassfish Memory

When a Glassfish domain is created it already comes with a default set of JVM options (including memory related options), as you keep working on your project your application will increasingly grow and consume more memory, until it reaches the point where the default Glassfish memory configuration isn’t appropriate to run your app anymore. If you are facing this problem you can easily increase the memory by following the instructions bellow:

1 – Open the glassfish console on your browser and click on server-config:

Glassfish Console
Glassfish Console

2 – Then click on JVM Settings:

Glassfish server-config screen
Glassfish server-config screen

3 – On the JVM Options tab these are the two options you may want to change: XX:MaxPermSize and Xmx.

Glassfish JVM Options
Glassfish JVM Options

As long as you have memory available on your server you can put any size you want here. After the modifications you just need to restart your server and you’re done!

Recommended for you

Leave a Reply

Your email address will not be published. Required fields are marked *

Obs: Use the tag <pre lang="LANGUAGE"> to include code blocks to your comment.
Example: <pre lang="javascript"> console.log('Test'); </pre>