Friday, August 19, 2011

Admin on Sun, Managed on JRockit

Today I ended up in a weird situation:
my Admin was started with Sun JDK (JAVA_VENDOR=Sun)
but my Managed Servers were runnning on JRockit (JAVA_VENDOR=Oracle). They were started using Node Manager.

I have no clue how I have done that.
Anyway here is the fix to run everything with Sun (I hate Sun and I love JRockit, but some customers use Sun, so...):

in C:\Oracle\Middleware\wlserver_10.3\common\bin\commEnv.cmd :
@rem Reset JAVA Home
rem set JAVA_HOME=C:\Oracle2\Middleware\jrockit_160_22_D1.1.1-3
set JAVA_HOME=C:\Oracle2\Middleware\jdk160_21

rem set JAVA_VENDOR=Oracle

That's all.

So now the second part of this psychodrama:
With Sun JDK, the Managed Server fails with:

java.lang.OutOfMemoryError: PermGen space

In JRockit there is no concept of PermGen, so there is no need to worry about it. But Sun must be taught how to behave itself.

If you think that fixing the C:\Oracle2\Middleware\wlserver_10.3\common\bin\commEnv.cmd is enough, you are wrong:

I changed it by using
set MEM_ARGS=-Xms32m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseSpinning

but this doesn't affect the way a Managed Server is run.
You must rather change the Server Start Arguments (beware, they are all mixed up in the same tab, the JVM parameters and the System parameters !)

No comments: