Oracle, Oracle SOA Suite August 9, 2010 0

JVM memory allocation between the managed servers in WLS 10.3

Oracle WebLogic Server 10.3 comes with default configuration of the JVM memory distribution between the managed servers. Assuming we have the “AdminServer” and one managed server “SOA_Server1” in “soadomin” domain, the JVM memory allocation will be the same for all servers by default.

In order to tune the JVM memory allocation for all managed servers and allocate desired amount of memory per a managed server an update of the configuration file can be performed.

Example configuration files in <MIDDLEWARE_HOME>/domains/soadomain/bin
Linux OS    : setSOADomainEnv.sh
Win OS      : setSOADomainEnv.cmd

Memory allocation will be set as follow
AdminServer     = 768MB
SOA_Server1    = 2048MB (2g)
Default memory = 1024MB (1g)

  • Entries for Linux:
if [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "SOA_Server1" ]; then
    DEFAULT_MEM_ARGS="-Xms2g -Xmx2g"
    PORT_MEM_ARGS="-Xms2g -Xmx2g"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "AdminServer" ]; then
    DEFAULT_MEM_ARGS="-Xms768m -Xmx768m"
    PORT_MEM_ARGS="-Xms768m -Xmx768m"
else
    DEFAULT_MEM_ARGS="-Xms1g -Xmx1g"
    PORT_MEM_ARGS="-Xms1g -Xmx1g"
fi

Linux WLS Cluster:

if [ "${SERVER_NAME}" = "SOA_Server1" ] || [ "${SERVER_NAME}" = "SOA_Server2" ]; then
     DEFAULT_MEM_ARGS="-Xms2g -Xmx2g"
     PORT_MEM_ARGS="-Xms2g -Xmx2g"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "AdminServer" ];then
     DEFAULT_MEM_ARGS="-Xms768m -Xmx768m"
     PORT_MEM_ARGS="-Xms768m -Xmx768m"
else
     DEFAULT_MEM_ARGS="-Xms1g -Xmx1g"
     PORT_MEM_ARGS="-Xms1g -Xmx1g"
fi
  • Entries for Windows

(In section :OracleJVM)

:OracleJVM

...
...

if "%SERVER_NAME%"=="AdminServer" (
   set USER_MEM_ARGS=-Xms768m -Xmx768m
   set PORT_MEM_ARGS=-Xms768m -Xmx768m

) else (
   set USER_MEM_ARGS=%DEFAULT_MEM_ARGS%
   set PORT_MEM_ARGS=%PORT_MEM_ARGS%
)

if "%SERVER_NAME%"=="SOA_Server1" (
   set USER_MEM_ARGS=-Xms2g -Xmx2g
   set PORT_MEM_ARGS=-Xms2g -Xmx2g
) else (
   set USER_MEM_ARGS=%DEFAULT_MEM_ARGS%
   set PORT_MEM_ARGS=%PORT_MEM_ARGS%
)

Start the WLS environment and test settings:

[weblogic@host ~]$ ps auxww |grep java