CoolThreads Try and Buy Application Resources

 
Begin Product Tab Sub Links

JBoss On Solaris Best Practices

Memory options

Memory requirements are very closely tied to your application, but below are some reasonable default options that should give you a good starting place. This will set up the JVM with 1 GB of memory:

-Xms1024m -Xmx1024m -XX:+UseParallelGC -XX:ThreadStackSize=128k

Turn off extraneous logging and tomcat dev mode

JBoss, by default, is designed to be simple for a developer to use. When you are ready to deploy your application, you should turn off some of the features that are most useful in development.

  1. Edit $JBOSS_HOME/server/default/deploy/jbossweb-tomcatXX.sar/conf/web.xml and turn off tomcat debug mode. There are also some other tuning variables that may or may not benefit your specific application. These options are well documented inside the web.xml file.
  2. Turn down logging by editing $JBOSS_HOME/server/default/conf/log4j.xml. JBoss uses Log4j which allows you a great flexibility to control logging. The default logging mode is INFO, but you can set it to a lower level such as ERROR to keep writes to disk to a minimum.
  3. Change the deployment scanner time. By default this is set to 5 seconds. This is great for development, but in production you will probably want to set this higher. Maybe 5 or 10 min? You can change this setting by editing the file $JBOSS_HOME/server/default/conf/jboss- service.xml. The scanner options are well documented there.

Use JDK 1.5

If at all possible, you should use JDK 1.5. The garbage collector has been significantly improved and you will often see immediate performance gains. If you can only use JDK 1.4 in your environment, you should change the RMI GC interval. In our experience, the default of 1 minute is much to short for most applications. This will cause a full GC every minute!

The following options are the default in recent JBoss releases:

-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000

These options set the GC interval to 1 hour, which is much more reasonable in most cases. The option -XX:+DisableExplicitGC will also prevent the RMI GC's from occurring every minute.

Remove unused services

If you aren't using some services that JBoss provides you should remove them to free up resources. This is a more advanced topic, but this page has a detailed description of how to do this.