I know there are many blogs out there that show how and where to change the memory configurations, .e.g. increase / decrease or swap between Sun and JRockit JVM. The reason for this post is more for me to have a reference easy to find, but it brings a few concepts together which are usually found in 2 or 3 blog posts:
- Memory modification
- Swapping JVM provider
- Node manager support
Many of the post out there are for changing the memory settings when running via the startWeblogic.sh script. Although this post will support running via the script it is more about starting via Node Manager.
For the purpose of this post I'm using the scripts developed in my post Startup Scripts for Weblogic and SOA Suite
Firstly we want to change the memory settings for the JVM. This is done in the setSOADomainEnv.sh script.
Make a copy of the file the open for modification:
$MW_HOME/user_projects/domains/soa_domain/bin/setSOADomainEnv.sh
Look for the lines:
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx1536m"
Comment these lines out and add the following straight after, e.g.
#DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
#PORT_MEM_ARGS="-Xms768m -Xmx1536m"
if [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "soa_server1" ]; then
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "AdminServer" ]; then
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx768m"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "bam_server1" ]; then
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx768m"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "osb_server1" ]; then
DEFAULT_MEM_ARGS="-Xms512m -Xmx1024m"
PORT_MEM_ARGS="-Xms768m -Xmx768m"
else
DEFAULT_MEM_ARGS="-Xms768m -Xmx768m"
PORT_MEM_ARGS="-Xms768m -Xmx768m"
fi
Depending on how you installed your environment you may need to add the JRockit home, this is done in the setDomainEnv.sh, as before make a copy and open the file for modification.
$MW_HOME/user_projects/domains/soa_domain/bin/setDomainEnv.sh
check the value for BEA_JAVA_HOME and make sure it is pointing to your JRockit location, e.g.
BEA_JAVA_HOME="/u01/jrockit/jrockit-jdk1.6.0_37-R28.2.5-4.1.0"
export BEA_JAVA_HOME
As I'm starting my SOA environment via load manager I need to make some additional changes.
The node manager properties need to be updated
$MW_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties
make sure the parameter StartScriptEnabled is set to true, e.g.
StartScriptEnabled=true
Also if you want to run JRockit you need to change the Java Homes
#javaHome=/u01/java/jdk1.6.0_38
javaHome=/u01/jrockit/jrockit-jdk1.6.0_37-R28.2.5-4.1.0
#JavaHome=/u01/java/jdk1.6.0_38/jre
JavaHome=/u01/jrockit/jrockit-jdk1.6.0_37-R28.2.5-4.1.0/jre
The last file that needs modification is the commEnv.sh, to change the Java Home.
$WL_HOME/common/bin/commEnv.sh
Comment out the old JAVA_ HOME and JAVA_VENDOR to point to JRockit, Before:
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
# Set up JAVA HOME
JAVA_HOME="/u01/java/jdk1.6.0_38"
# Set up JAVA VENDOR, possible values are
#Oracle, HP, IBM, Sun ...
JAVA_VENDOR=Sun
# PRODUCTION_MODE, default to the development mode
PRODUCTION_MODE=""
fi
After
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
# Set up JAVA HOME
#JAVA_HOME="/u01/java/jdk1.6.0_38"
JAVA_HOME="/u01/jrockit/jrockit-jdk1.6.0_37-R28.2.5-4.1.0"
# Set up JAVA VENDOR, possible values are
#Oracle, HP, IBM, Sun ...
#JAVA_VENDOR=Sun
JAVA_VENDOR=Oracle
# PRODUCTION_MODE, default to the development mode
PRODUCTION_MODE=""
fi
You should be now ready to start your environment. All servers should now start in JRockit, to test this you can run the command:
ps -ef | grep soa_server1
It should have JRockit in the classpath.