Thursday 14 August 2014

Oracle Glasshfish memory setings

In case that you want to change default Oracle glassfish java memory settings, you should do following thing. Find domain.xml file in you glassfish domain folder. Location of domain.xml is something like this glassfish_home/glassfish/domains/domain1/config/ . In case that you can't find domain.xml file use find command to use it.

server#cd glassfish_home
server#find . -name domain.xml
./glassfish/domains/domain1/config/domain.xml

In this file find this section:

<jvm-options>-XX:PermSize=256m</jvm-options>
        <jvm-options>-Xmx1024m</jvm-options>
        <jvm-options>-Dgosh.args=--nointeractive</jvm-options>
        <jvm-options>-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder</jvm-options>
        <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options>
        <jvm-options>-XX:MaxPermSize=512m</jvm-options>

Memory settings are changed in these lines:

<jvm-options>-XX:PermSize=256m</jvm-options>
<jvm-options>-Xmx1024m</jvm-options>
<jvm-options>-XX:MaxPermSize=512m</jvm-options>
   

We won't be talking about what there parameters means.
After you change these settings you have to restart your oracle glassfish domain
 server#./asadmin stop-domain domain1
 server#./asadmin start-domain domain1



No comments: