Friday, April 10, 2015

Oracle Weblogic: Setting independant JVM values for Managed Server in setDomainEnv.sh

Version: 

WLS 10.3.6 or FMW Infrastructure 12.1.3

Requirement:

Set the managed server to start with 1GB heap size and 1GB permgen space.

Steps:

1. Open the setDomainEnv.sh (under $DOMAIN_HOME/bin) in a text editor like vi

2. Search the file for the line starting with "IF USER_MEM_ARGS"

    Search for the commented out line starting with "IF USER_MEM_ARGS the environment variable     is set" in the file

3. Add the memory settings for your managed server below that line.
   
    Add the required settings for your managed server. 

Eg: 

# IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values

if [ "${SERVER_NAME}" == "PRD_ManServer1" ] ; then
     USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m"
export USER_MEM_ARGS
fi
f [ "${USER_MEM_ARGS}" != "" ] ; then
        MEM_ARGS="${USER_MEM_ARGS}"
        export MEM_ARGS
fi

where PRD_MasServer1 is the name of my managed server. I have set both Java heap and permgen space to 1024 (both low and high values) in the above example.

4. Save the file and quit. Restart the managed service

5. Verify the change

    Grep weblogic process to make sure the change is effective

Eg: 

ps -ef|grep weblogic

/java/bin/java -server -Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m -Dweblogic.Name=PRD_ManServer1

1 comment:

  1. Simply wish to say your article is as astonishing. The clarity in your post is simply great, and I could assume you are an expert on this subject. Same as your blog i found another one Oracle WebLogic .Actually I was looking for the same information on internet for Oracle WebLogic and came across your blog. I am impressed by the information that you have on this blog. Thanks a million and please keep up the gratifying work.

    ReplyDelete