Archive for December, 2006

Run JBoss as a Windows Service on BEA’s JRockit JVM using Java Service Wrapper - not JavaService

Now that's a long title, but still not long enough. It doesn't mention the "java.lang.OutOfMemoryError: PermGen space" errors that led to the use of BEA's JRockit as the JVM of choice for our application server.

After reading several resources (#1, #2, #3) we'd determined the cause of our PermGen Problems:

  • Continuous integration was causing frequent "Hot" deployment to our application server (Tomcat 5.5 then JBoss 4.0.4 - Same problem on both). We're crediting the JVM's garbage collecting for not correctly unloading the "old"/previously deployed classes, thus causing the PermGen to run out of space.
  • Using Cruise Control running on Jetty, every time the build ran, we'd get a PermGen OutOfMemoryError during JUnit test target execution. We're crediting JUnit for this problem due to the massive class creation/loading that it uses to provide it's much appreciated "clean" environment with every test.

We temporarily solved the problem by not deploying "Hot"; automatically restarting the server instead. The JUnit test problem was temporarily solved by increasing the Jetty server's max PermGen size using the -XX:MaxPermSize=128m JVM arg. Neither of these solutions are great. The most commonly suggested real solution to these problems is to switch to BEA's JRockit JVM - I guess it doesn't have a Permanent Generation memory space so it's impossible to get PermGen memory errors.

Our next step... Running JBoss on BEA's JRockit JVM as a Window's service using JavaService... This didn't work. Why? I have no idea. After a lot of searching for JavaService and JRockit recipes and only finding unanswered questions to a common problem, "...the service will install correctly, but it won't start..." (orsomethinglikethat), I gave Java Service Wrapper a try. I initially preferred JavaService for it's simplicity and small learning curve for the impatient, but Java Service Wrapper works (even with JRockit) and isn't too complicated after a little reading.

To summarize my ramblings to this point: If you're having PermGen memory problems, then BEA's JRockit JVM may be your answer - just don't try to use it in combination with JavaService. Use Java Service Wrapper instead. Here's how to configure Java Service Wrapper to run JBoss on JRockit Read more »

Goodbye Yahoo! TV - Hello TV Guide