Changing the heap size of the OMS in EM12c

Generally speaking, the Java heap memory utilization for your Oracle Management Service (OMS) should be averaging at under 75%, and anything over this could mean the Garbage Collection starts impacting the performance of your Enterprise Manager experience.

If you’re using the “out-of-the-box” notification rules, then an OMS suffering such symptoms may start churning out events like this:

EM Event: Critical:/EMGC_GCDomain/GCDomain/EMGC_OMS1 – The heap usage is 91%.

In this particular example, I’m running a relatively small Enterprise Manager Cloud Control 12c configuration (less than 1,000 targets), but the 1GB heap size that’s been allocated isn’t quite enough any longer, and the heap usage for the primary OMS is over 90% quite frequently.  Oracle advise the OMS heap size be increased to 4GB as a minimum when your installation is considered a ‘medium’ configuration (amongst other settings), so I’ve decided to go for 2GB here.  Obviously you need to make sure you have sufficient physical memory on your server to cope with the increase ;)

There is a good article on the OTN around sizing requirements for the database repository and OMS components here.

Oracle documentation around hardware requirements for a Cloud Control installation can also be found here.

 

First of all, backup the startEMServer.sh script, then increase the Java heap sizing to meet your requirements:

cd /u01/app/oracle/middleware/oms12c/gc_inst/user_projects/domains/GCDomain/bin
cp startEMServer.sh startEMServer.sh.bak
vi startEMServer.sh

Look for the first USER_MEM_ARGS reference within the file and change from this:

if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then
 USER_MEM_ARGS="-Xms256m -Xmx1024m -XX:MaxPermSize=612M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled"
 if [ "${JAVA_VENDOR}" = "Sun" ] ; then
 if [ "${PRODUCTION_MODE}" = "" ] ; then
 USER_MEM_ARGS="-Xms256m -Xmx1024m -XX:MaxPermSize=612M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000 -XX:PermSize=128m"

…to this (I’m changing the heap size of my OMS from 1GB to 2GB here):

if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then
 USER_MEM_ARGS="-Xms1024m -Xmx2048m -XX:MaxPermSize=1024M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled"
 if [ "${JAVA_VENDOR}" = "Sun" ] ; then
 if [ "${PRODUCTION_MODE}" = "" ] ; then
 USER_MEM_ARGS="-Xms1024m -Xmx2048m -XX:MaxPermSize=1024M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000 -XX:PermSize=128m"

Once that’s done for each OMS, you just need to restart your OMS(es) to the changes to take effect:

export OMS_HOME= /u01/app/oracle/middleware/oms12c/oms
$OMS_HOME/bin/emctl stop oms
$OMS_HOME/bin/emctl start oms

Check that your OMS has started up with the correct memory settings:

grep "JAVA Memory arguments" /u01/app/oracle/middleware/oms12c/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/EMGC_OMS1.out

JAVA Memory arguments: -Xms1024m -Xmx2048m -XX:MaxPermSize=1024M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000 -XX:PermSize=128m

I noticed quite a significant improvement in performance after increasing this, so it’s worth keeping an eye on it from time to time!

Leave a comment

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>