3

Regarding a Java EE application and WebLogic; I've noticed that I could change the Java VM (Sun JDK or JRockit) in different places:

  1. During creation of the WebLogic Domain
  2. Project classpath
  3. During creation of WebLogic Server Runtime Environment
  4. Other?

Can you explain me what happens if I change one of the different settings?

Mike Braun
  • 3,729
  • 17
  • 15
user2010955
  • 3,871
  • 7
  • 34
  • 53

2 Answers2

3

The only real difference is that JRockit is specifically tuned to work with Weblogic so you'll see performance improvements. Memory settings will change when picking one or the other as well.

There are two easy ways to guarantee what JVM your server uses when it is started:

  • You can explicitly set the JVM on the 'Server Start' tab for a managed server. This only applies when the server is started via the nodemanager.
  • Set both BEA_JAVA_HOME and SUN_JAVA_HOME in the setDomainEnv.sh file. We set them both to the same value because we always want a particular JVM

Like you said, there are other places the value can be set but I think the above 2 options are the easiest way to go.

Display Name is missing
  • 6,197
  • 3
  • 34
  • 46
  • I don't think setting both BEA_JAVA_HOME and SUN_JAVA_HOME makes sense, since they support different flags. You cannot start a JRockit instance with Oracle JVM debug flags set. – eis Jan 13 '14 at 17:49
  • It will at least force you to understand what the difference is. – Display Name is missing Jan 13 '14 at 18:25
  • So, on my local computer, If i'd like to switch from Oracle JDK to JRockit JDK, where should I change this setting making sure that WebLogic will use JRockit for all my deployed web application? Thanks :D – user2010955 Jan 14 '14 at 08:25
  • 1
    Easiest way is to edit your `setDomainEnv.sh` file and set the JAVA_VENDOR near the top and also make sure that `BEA_JAVA_HOME` is pointed at the jrockit folder. You can also try and set JAVA_VENDOR and JAVA_HOME in your environment before running `startWebLogic.sh` – Display Name is missing Jan 14 '14 at 16:04
0

There are really only two main use cases that I can think of. Standalone client apps, which care about startup time and not about GC in the long run, and server usage, which doesn't really care about startup time but GC and steady performance in the long rung is vital. Some apps may create (class) instances runtime a lot more than others, so that might have an impact as well.

About the differences:

  1. JRockit doesn't really have PermGen, but uses regular heap for the same. As some software have issues with PermGen not getting collected, JRockit behaves better on those. Oracle/Sun VM has Eden space, survivior space, tenured generation and permanent generation, whereas JRockit has just young generation and old generation.
  2. Garbage collection strategies are somewhat different. Depends on the software which one is best suited for a given situation.
  3. Debug flags are different, and some debugging software expect a certain JDK. JRockit has JRockit mission control which is an advanced tool on monitoring the current status of your JVM. Some version is free to download, for latest patches you need an Oracle support contract. With Oracle VM, you can use all the standard tools: visualvm, jhat, jmap, jprof, MAT, jstat. It's a matter of taste and use case which one you prefer.

If you change it manually, you will likely see an error about unsupported debug flags. Once you change those, you can hit a PermGen error earlier on the Oracle VM: other than that, I would expect you only see a difference in GC profiles and/or performance testing.

In the long run you might want to take a look at what this thread has to say. JRockit and Oracle JVM will become one and the same.

Community
  • 1
  • 1
eis
  • 51,991
  • 13
  • 150
  • 199