I want to share my experience in changing the settings for the allocated memory in Glassifish. In particular, changing the amount of initial memory (-Xms) and changing the maximum memory (-Xmx) allocated to Glassfish.
To do so I used the asadmin CLI tool which is part of the Glassfish installation. It is found in the bin directory.
./asadmin to start the asadmin console. Next, using the command
list the command-line options that are passed to the Java application launcher when GlassFish Server is started. Check, the actual value of the settings you want to change. Say you see that your Glassfish is set with initial allocated memory of 1536 MB. In such case, in the list you should see
Then, run the following command to add your preferred value:
This will add the ‘Xms3g’ setting to the Glassifish settings options. Next, you need to delete the previous settings
'-Xms1536m'. To delete, run the following command:
You are done! The changes to take effect, you need to restart the Glassfish. To restart run:
Maybe a bit complicated, but this is how I change Glassifish JVM settings.