Running GlassFish with JRockit
Join the DZone community and get the full member experience.
Join For FreeGetting started
Get the latest GlassFish 3.0.1 and the latest Oracle JRockit 28.1. Start with installing the JRockit to a suitable location. After that, start the GlassFish installer and do the same. Select the JRockit installation folder if you are asked to select the JDK. Finish the GlassFish installation. and change to %GF_HOME$/bin and type asadmin start-domain.
You will see something like this:
Waiting for DAS to start .Error starting domain: domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
[WARN ][jrockit] MaxPermSize=192m ignored: Not a valid option for JRockit
[WARN ][jrockit] NewRatio=2 ignored: Not a valid option for JRockit
Could not create the Java virtual machine.
Unknown option or illegal argument: -XX:+LogVMOutput.
Please check for incorrect spelling or review documentation of startup options.
Configure your Domain
Both JVM options are invalid for JRockit. So you have to get a hand on your %GF_HOME%/glassfish/domains/domain1/config/domain.xml and comment out or remove the following three lines in the <java-config> section:
<jvm-options>-XX:+LogVMOutput</jvm-options>
<jvm-options>-XX:MaxPermSize=192m</jvm-options>
<jvm-options>-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log</jvm-options> After that try restarting your domain and you will see, it works.
If you run the admin console and select "Enterprise Server > JVM Report" you will see, that the Oracle JRockit is now used.
This seems to be a know issue and will be fixed in the next GlassFish 3.1 release.
Why JRockit?
There are a couple of reasons. It's simple the most powerful JVM on earth. But my favorite is the Mission Control Tooling. includes tools to monitor, manage, profile, and eliminate memory leaks in your Java application. You can simply browse any resources on the server and have a very handy tooling for identifying problems. The most powerful thing is the Flight Recording feature. You can monitor your JVM like a blackbox and collect runtime information with minimal overhead. The flight recording option is enabled by default. You simple need to take your probe for as long as you need it and analyze it with the JRMC.
JRockit
Flight Recorder does all this by being tightly integrated into the JVM
and by being very conscious of its performance overhead. It provides a
wealth of information on the inner workings of the JVM as well as on the
Java program running in the JVM. You can use this information for
profiling and for root cause analysis of problems. It can be enabled at
all times, without causing performance overhead—even in heavily loaded,
live production environments.
If you are looking for more details also compare my Flight Recorder
post. There are some more experimental features available which you
could install by simply selecting "Help > Install Plugins". A
WebLogic plugin is available. I would love to have a separate for
GlassFish also.
From http://blog.eisele.net/2011/01/running-glassfish-with-jrockit.html
Opinions expressed by DZone contributors are their own.
Trending
-
Integrate Cucumber in Playwright With Java
-
Adding Mermaid Diagrams to Markdown Documents
-
Operator Overloading in Java
-
Building a Flask Web Application With Docker: A Step-by-Step Guide
Comments