WLS JVM Settings

1k views Asked by At

First of all I am new to WLS. I have been searching for this issue since yesterday but couldn't find a solution. I am getting this error:

C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client   -Xms512m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=512m -XX:MaxPermSize=1024m -Dweblogic.Name=DefaultServer - ....
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

I have setted the JVM options in setDomainEnv.cmd (I am on Windows 7 64-bit) like this:

@REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
set USER_MEM_ARGS=-Xms512m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=512m -XX:MaxPermSize=1024m

if NOT "%USER_MEM_ARGS%"=="" (
    set MEM_ARGS=%USER_MEM_ARGS%
)

I also changed these values:

set XMS_SUN_64BIT=512
set XMS_SUN_32BIT=512
set XMX_SUN_64BIT=1024
set XMX_SUN_32BIT=1024
set XMS_JROCKIT_64BIT=512
set XMS_JROCKIT_32BIT=512
set XMX_JROCKIT_64BIT=1024
set XMX_JROCKIT_32BIT=1024


if "%JAVA_VENDOR%"=="Sun" (
    set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx1024m
    set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx1024m
) else (
    set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx1024m
    set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx1024m
)

if "%JAVA_VENDOR%"=="Oracle" (
    set CUSTOM_MEM_ARGS_64BIT=-Xms%XMS_JROCKIT_64BIT%m -Xmx%XMX_JROCKIT_64BIT%m
    set CUSTOM_MEM_ARGS_32BIT=-Xms%XMS_JROCKIT_32BIT%m -Xmx%XMX_JROCKIT_32BIT%m
) else (
    set CUSTOM_MEM_ARGS_64BIT=-Xms%XMS_SUN_64BIT%m -Xmx%XMX_SUN_64BIT%m
    set CUSTOM_MEM_ARGS_32BIT=-Xms%XMS_SUN_32BIT%m -Xmx%XMX_SUN_32BIT%m
)

but they did not change the result. What is wrong with the above configuration?

1

There are 1 answers

0
lamostreta On BEST ANSWER

The problem was the MAVEN_OPTS environmental variable. It was: MAVEN_OPTS = -Xmx512m -XX:MaxPermSize=1024m I changed it to: -Xms512m -Xmx1024m --XX:PermSize=512m -XX:MaxPermSize=1024m