X

Best Practices, tips and news for managing Oracle’s Engineered Systems for both on-premise and cloud.

Java Heap Size Settings For Enterprise Manager 12c

This blog is to provide an update to a previous blog (Oracle Enterprise Manager 12c Configuration Best Practices (Part 1 of 3)) on how to increase the java heap size for an OMS running release 12cR3.  The entire series can be found in the My Oracle Support note titled Oracle Enterprise Manager 12c Configuration Best
Practices [1553342.1]
.

Increase JAVA Heap Size

For larger enterprises, there may be a
need to increase the amount of memory used for the OMS.  One of the
symptoms of this condition is a “sluggish” performance on the OMS.  If
it is determined that the OMS needs more memory, it is done by
increasing the JAVA heap size parameters.  However, it is very important
to increase this parameter incrementally and be careful not to consume
all of the memory on the server.  Also, java does not always perform
better with more memory. 

Verify:  The parameters for the java heap size are stored in the following file:

<MW_HOME>/user_projects/domains/GCDomain/bin/startEMServer.sh

Recommendation:  If
you have more than 250 agents, increase the -Xmx parameter which
specifies the maximum size for the java heap to 2 gb.  As the number of
agents grows, it can be incrementally increased.  Note:  Do not increase
this larger than 4gb without contacting Oracle.  Change only the –Xmx
value in the line containing USER_MEM_ARGS="-Xms256m –Xmx1740m
…options…" as seen in the example below.   Do not change the Xms or
MaxPermSize values. Note:  change both lines as seen below.  The second
occurrence will be used if running in debug mode.

Steps to modify the Java setting for versions prior to 12cR3 (12.1.0.3)

Before

 if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then
  USER_MEM_ARGS="-Xms256m -Xmx1740m
-XX:MaxPermSize=768M -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 -Xmx1740m
-XX:MaxPermSize=768M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing
-XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
-XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000
-XX:PermSize=128m"
    fi
  fi
  export USER_MEM_ARGS
fi

After

 if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then
  USER_MEM_ARGS="-Xms256m -Xmx2560m -XX:MaxPermSize=768M
-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 –Xmx2560m
-XX:MaxPermSize=768M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing
-XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
-XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000
-XX:PermSize=128m"
    fi
  fi
  export USER_MEM_ARGS
fi

Steps to modify the Java setting for version 12.1.0.3

emctl set property -name JAVA_EM_MEM_ARGS -value "<value>"
emctl stop oms -all
emctl start oms

Please note
that this value gets seeded inside emgc.properties and is used to start
the OMS.  Please be careful setting this property as this would be the
property used by the OMS to start and the oms can fail to start if it is
not specified correctly.  Below is an example of the command:

emctl set property -name JAVA_EM_MEM_ARGS -value "-Xms256m -Xmx2048m
-XX:MaxPermSize=768M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing
-XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
-XX:+CMSClassUnloadingEnabled"

 

Join the discussion

Comments ( 4 )
  • john Monday, October 7, 2013

    What is the max heap size for 32bit and 64bit versions respectively? I use both on different purpose. Usually 32bit on VPS, and 64bit on dedicated. Thank you


  • Bethany Lapaglia Tuesday, October 8, 2013

    On 32bit: There is a hard limit of 1.7Gb. If you go above that, the JVM will misbehave and crash.

    On 64bit: You can go pretty high (16gb and beyond), but the more JAVA heap you allocate, the longer it will take for the JVM to initialize, and the more disc space you will need for those JAVA core dumps. Values between 2gb and 4gb are 'normal'. If you go above 4gb, you should contact Oracle, to see why you would need so much memory. There could be other parameters that may need to be tuned.


  • Dan Thursday, November 21, 2013

    We are running OEM12c (12.1.0.2) on AIX 6.1. We are showing signs of needing to increase the OMS JAVA Heap size. The current configuration is the default and it has the following:

    if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then

    USER_MEM_ARGS="-Xms1740m -Xmx1740m -Xgcpolicy:gencon "

    if [ "${JAVA_VENDOR}" = "Sun" ] ; then

    if [ "${PRODUCTION_MODE}" = "" ] ; then

    USER_MEM_ARGS="-Xms1740m -Xmx1740m -Xgcpolicy:gencon -XX:CompileThreshold=8000 -XX:PermSize=128m"

    fi

    fi

    export USER_MEM_ARGS

    fi

    According to this blog and Doc ID 1553342.1 a recommendation regarding the JAVA heap size shows the following:

    if [ "${SERVER_NAME}" != "EMGC_ADMINSERVER" ] ; then

    USER_MEM_ARGS="-Xms256m -Xmx2560m -XX:MaxPermSize=768M

    -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 –Xmx2560m

    -XX:MaxPermSize=768M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing

    -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

    -XX:+CMSClassUnloadingEnabled -XX:CompileThreshold=8000

    -XX:PermSize=128m"

    fi

    fi

    export USER_MEM_ARGS

    fi

    My question is regarding the "missing" config parameters in the JAVA config in our environment. Should these be added in addition to increasing the heap to -Xmx2560?

    -XX:MaxPermSize=768M -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M

    -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled"


  • guest Friday, November 22, 2013

    Dan, All of the java parameters are needed however, I am not familair with the AIX platform so I am not sure if they all apply on your platform.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services