» Adjusting Development Memory Usage for JBoss 5.x
Posted by Anders Østergaard Jensen on 1/20 2010 at 7:07 AMJBoss is an extremely popular Java EE application server. But, as excellent it may be, it definitely sucks up a lot of memory – also when in development mode. If you have plenty of memory (more than 2 gigabytes, I would say), you can speed up the waiting time for performing so-called hot redeploys. Hot redeployment happens, for instance, when you redeploy a packaged application EAR file from within Netbeans, which is responsible for propagating the EAR chunk to the correct directory. Reloading EAR files from scratch, especially if you have a lot of JPA/Hibernate related configuration directives, can be a lengthy process and increasing the memory available to JBoss can speed up this process significantly.
What we will do is simply to increase the JVM (Java Virtual Machine) memory on JBoss. This is done in the file <jboss-dir>/bin/run.conf. Find the line containing the following:
# # Specify options to pass to the Java VM. # if [ "x$JAVA_OPTS" = "x" ]; then JAVA_OPTS="-Xms256m -Xmx1512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.cli ent.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" fi
The two parameters, -Xms256m and -Xmx1512m specify the minimum (lower) and maximum (upper) JVM memory consumption limits. Normally, the maximum (-XmxXXXm) is set to 512, but in case you have enough memory, you can easily increase this to e.g. 1024 MB (-Xmx1024m) or 2048 MB (-Xmx2048m). That way, you can easily cut off a lot of the time unwillingly spent on waiting for your EAR files to redeploy during development.



