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

Automatically Mapping JPA Entities with Netbeans Creating the JPA entities manually can be really time consuming, specially if you're working with a huge database with hundreds of tables. Luckily, Netbeans IDE can automatically create the entities for us, if you want to see how just follow the instructions bellow: 1 - Right click on your packag...
React.js Tutorial: Consuming JavaEE RESTful Web Services In this post I'm going to show how to consume Web Services with React.js, more specificalyJavaEE RESTful Web Services. I've already written a post showing how to create these web services with EJB 3, if you haven't seen it yet just click on this link for more details, but if you're already familiar ...
Example of ServletContextListener Implementation According to Oracle official documenentation, the ServletContextListener Interface is responsible for receiving notifications about the ServletContext lifecycle changes, more specifically its initialization and destruction. This can be really helpful for developers in some specific situations, like ...

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>