Change Java Heap大小
有时我们可能根据需要去修改Java所占内存的大小。当测试机器性能不够好时,我们可以将她调小。当出现Out Of Memory时,我们可能需要将她调大等。我们有2种方法去修改Java Heap的大小。
第一种:修改startEMServer.sh文件
首先备份user_projects/domains/GCDomain/bin/startEMServer.sh文件,然后修改类似下面的参数USER_MEM_ARGS="-Xms256M -Xmx1740M -XX:PermSize=128M -XX:MaxPermSize=1024M"
if [ "${PRODUCTION_MODE}" = "" ] ; then
USER_MEM_ARGS="-Xms256M -Xmx1740M -XX:PermSize=128M -XX:MaxPermSize=1024M -XX:CompileThreshold=8000 -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled"
fi
fi
export USER_MEM_ARGS
case $SERVER_NAME in
EMGC_OMS*)
if [ "${JBO_MIN_POOL_SIZE}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.minavailablesize=${JBO_MIN_POOL_SIZE} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.minavailablesize=1 "
fi
export JAVA_OPTIONS
if [ "${JBO_POOL_TTL}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.timetolive=${JBO_POOL_TTL} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.timetolive=-1 "
fi
export JAVA_OPTIONS
if [ "${JBO_LAZY_LOAD}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.load.components.lazily=${JBO_LAZY_LOAD} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.load.components.lazily=true "
fi
export JAVA_OPTIONS
if [ "${JBO_MAX_CURSORS}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.max.cursors=${JBO_MAX_CURSORS} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.max.cursors=5 "
fi
export JAVA_OPTIONS
if [ "${JBO_RECYC_THRESHOLD}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.recyclethreshold=${JBO_RECYC_THRESHOLD} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.recyclethreshold=50 "
fi
export JAVA_OPTIONS
if [ "${JBO_MAX_POOL_SIZE}" != "" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.maxavailablesize=${JBO_MAX_POOL_SIZE} "
else
JAVA_OPTIONS="${JAVA_OPTIONS} -Djbo.ampool.maxavailablesize=50 "
fi
export JAVA_OPTIONS
if [ "${DEBUG_STARTUP}" = "TRUE" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.Debug=weblogic.application.times,weblogic.slc -Ddebug.addTimeStamp=true -Dweblogic.log.StdoutSeverity=Debug "
fi
if [ "${GCDEBUG}" = "TRUE" ] ; then
JAVA_OPTIONS="${JAVA_OPTIONS} -Xloggc:${T_WORK}/loggc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps "
fi
export JAVA_OPTIONS
if [ "${OMS_HEAP_MIN}" != "" ] ; then
USER_MEM_ARGS="-Xms${OMS_HEAP_MIN}"
else
USER_MEM_ARGS="-Xms256M"
fi
export USER_MEM_ARGS
if [ "${OMS_HEAP_MAX}" != "" ] ; then
USER_MEM_ARGS="${USER_MEM_ARGS} -Xmx${OMS_HEAP_MAX}"
else
USER_MEM_ARGS="${USER_MEM_ARGS} -Xmx1740M"
fi
export USER_MEM_ARGS
if [ "${OMS_PERMGEN_MIN}" != "" ] ; then
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:PermSize=${OMS_PERMGEN_MIN}"
else
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:PermSize=128M"
fi
export USER_MEM_ARGS
if [ "${OMS_PERMGEN_MAX}" != "" ] ; then
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:MaxPermSize=${OMS_PERMGEN_MAX}"
else
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:MaxPermSize=1024M"
fi
export USER_MEM_ARGS
if [ "${JAVA_EM_MEM_ARGS}" != "" ] ; then
USER_MEM_ARGS="${JAVA_EM_MEM_ARGS}"
export USER_MEM_ARGS
fi
export USER_MEM_ARGS
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:CompileThreshold=8000 -XX:-DoEscapeAnalysis -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=100M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled"
export USER_MEM_ARGS
;;
BIP*)
USER_MEM_ARGS="-Xms256M -Xmx1024M -XX:MaxPermSize=512M"
if [ "${JAVA_EM_MEM_ARGS}" != "" ] ; then
USER_MEM_ARGS="${JAVA_EM_MEM_ARGS}"
fi
export USER_MEM_ARGS
BI_ORACLE_HOME="/pemrep/fmw/oms/bi"
export BI_ORACLE_HOME
EXTRA_JAVA_PROPERTIES="-Dxdo.server.config.dir=/pemrep/fmw/gc_inst/user_projects/domains/GCDomain/config/bipublisher -Dxdo.server.lightweight=true -DXDO_FONT_DIR=$BI_ORACLE_HOME/common/fonts -Dweblogic.DefaultProtocol=t3s -Dweblogic.jsp.javacompiler.javac=true ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES
PRE_CLASSPATH="${BI_ORACLE_HOME}/bifoundation/jdbc/jdk16/bijdbc.jar:${PRE_CLASSPATH}"
export PRE_CLASSPATH
;;
EMGC_JVMDMANAGER*)
USER_MEM_ARGS="-Xms256M -Xmx1024M -XX:MaxPermSize=512M"
export USER_MEM_ARGS
;;
esac
第二种:通过emctl命令去修改
首先emctl list properties -module emoms获得Java Heap相关参数的值
OMS_HEAP_MAX=1740M
OMS_HEAP_MIN=256M
OMS_PERMGEN_MAX=768M
OMS_PERMGEN_MIN=128M
emctl set property -name <name > -value <n>
emctl stop oms -all
emctl start oms
-bash-4.2$ emctl set property -name OMS_HEAP_MAX -value 1024
Oracle Enterprise Manager Cloud Control 13c Release 1
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
SYSMAN password:
Property OMS_HEAP_MAX for oms occprod:4889_Management_Service has been set to value 256
OMS restart is required to reflect the new property value
-bash-4.2$ emctl set property -name OMS_PERMGEN_MAX -value 512
Oracle Enterprise Manager Cloud Control 13c Release 1
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
SYSMAN password:
Property OMS_PERMGEN_MAX for oms occprod:4889_Management_Service has been set to value 512
OMS restart is required to reflect the new property value
-bash-4.2$
-bash-4.2$ emctl list properties -module emoms
Oracle Enterprise Manager Cloud Control 13c Release 1
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
SYSMAN password:
Property Details
Management Server : occprod:4889_Management_Service
Module = EMOMS
JAVA_EM_ARGS=<Not Set>
JAVA_EM_MEM_ARGS=<Not Set>
JBO_LAZY_LOAD=true
JBO_MAX_CURSORS=5
JBO_MAX_POOL_SIZE=50
JBO_MIN_POOL_SIZE=1
JBO_POOL_TTL=-1
JBO_RECYC_THRESHOLD=50
OMS_HEAP_MAX=1740M
OMS_HEAP_MIN=256M
OMS_PERMGEN_MAX=768M
OMS_PERMGEN_MIN=128M
em.targetauth.db.pki.KeyStore=null
em.targetauth.db.pki.KeyStorePassword=null
em.targetauth.db.pki.KeyStoreType=null
em.targetauth.db.pki.TrustStore=null
em.targetauth.db.pki.TrustStorePassword=null
em.targetauth.db.pki.TrustStoreType=null
emConfigMBeanPort=0
is_admin_server=true
max_target_pooled_connections=4
oracle.sysman.asr.diag_retry_count=3
oracle.sysman.asr.diag_retry_freq=15
oracle.sysman.asr.diagcoll_incident_count_interval=1
oracle.sysman.asr.diagcoll_incident_count_maximum=1
oracle.sysman.asr.dts_base_url=https://transport.oracle.com/v1
oracle.sysman.asr.heart_beat_freq=5
oracle.sysman.asr.mode=DEF
oracle.sysman.asr.reopenSRInterval=24
oracle.sysman.asr.serial_number_prop_name=serial_number
oracle.sysman.asr.type=SW
oracle.sysman.asr.type_prop_name=Metal Level
oracle.sysman.core.agent.upgradeTime=60
oracle.sysman.core.console.EnableConsolePerfTracing=true
oracle.sysman.core.dataExchange.FirstDatasetWindow=60
oracle.sysman.core.dataExchange.IntervalBetweenMessage=2
oracle.sysman.core.dataExchange.MaxDataPointsPerMessage=100
oracle.sysman.core.dataservice.max_fetch_rows=2000
oracle.sysman.core.emd.httpReadTimeout=180
oracle.sysman.core.events.disable=false
oracle.sysman.core.events.ems.downtimeContact=null
oracle.sysman.core.events.ems.emsURL=null
oracle.sysman.core.events.max_worker_threads=8
oracle.sysman.core.events.rca.cache_size=100
oracle.sysman.core.events.rca.enable_availabilty_rca=true
oracle.sysman.core.events.rca.max_threads=20
oracle.sysman.core.events.rca.trace_enabled=true
oracle.sysman.core.events.rca.update_delay=900
oracle.sysman.core.events.rca.wait_for_tgt_startup=10
oracle.sysman.core.gcha.configureBIP=true
oracle.sysman.core.gcloader.dump_agent_list=null
oracle.sysman.core.gcloader.max_recv_thread=20
oracle.sysman.core.gcloader.trace_agent=null
oracle.sysman.core.gcloader.trace_data_type=null
oracle.sysman.core.metric.mextDeployRetryCount=25
oracle.sysman.core.metric.propagateTargetRetryCount=25
oracle.sysman.core.notification.cmds_per_minute=5000
oracle.sysman.core.notification.disable=false
oracle.sysman.core.notification.email_content_transfer_encoding=8-bit
oracle.sysman.core.notification.emails_per_connection=20
oracle.sysman.core.notification.emails_per_minute=5000
oracle.sysman.core.notification.grace_period=null
oracle.sysman.core.notification.grace_period_connector=null
oracle.sysman.core.notification.grace_period_email=null
oracle.sysman.core.notification.grace_period_java=null
oracle.sysman.core.notification.grace_period_oscmd=null
oracle.sysman.core.notification.grace_period_plsql=null
oracle.sysman.core.notification.grace_period_snmp=null
oracle.sysman.core.notification.grace_period_ticket=null
oracle.sysman.core.notification.locale.email=null
oracle.sysman.core.notification.locale.oscmd=null
oracle.sysman.core.notification.locale.plsql=null
oracle.sysman.core.notification.locale.snmp=null
oracle.sysman.core.notification.max_delivery_threads=24
oracle.sysman.core.notification.max_email_delivery_time=3600
oracle.sysman.core.notification.max_java_delivery_time=86400
oracle.sysman.core.notification.max_plsql_delivery_time=86400
oracle.sysman.core.notification.max_snmp_delivery_time=86400
oracle.sysman.core.notification.max_ticket_delivery_time=86400
oracle.sysman.core.notification.minimum_grace_period=60
oracle.sysman.core.notification.os_cmd_timeout=30
oracle.sysman.core.notification.oscmd.max_env_var_length=512
oracle.sysman.core.notification.parser.debug=false
oracle.sysman.core.notification.plsql_per_minute=5000
oracle.sysman.core.notification.publish_brownout_events=TRUE
oracle.sysman.core.notification.send_prior_status_after_agent_unreachable_clears=true
oracle.sysman.core.notification.short_format=both
oracle.sysman.core.notification.short_format_length=155
oracle.sysman.core.notification.smtp.connectiontimeout=60
oracle.sysman.core.notification.smtp.debug=false
oracle.sysman.core.notification.smtp.timeout=180
oracle.sysman.core.notification.snmp.max_oid_length=2160
oracle.sysman.core.notification.snmp_packet_length=5120
oracle.sysman.core.notification.traps_per_minute=5000
oracle.sysman.core.patch.consumer=null
oracle.sysman.core.ping.reversePingInterval=120
oracle.sysman.core.procedure.steplevel_graceperiod=-1
oracle.sysman.core.procedure.use_classic_view_as_default=false
oracle.sysman.core.security.auth.autoprovisioning=null
oracle.sysman.core.security.auth.autoprovisioning_minimum_role=null
oracle.sysman.core.security.auth.enable_username_mapping=null
oracle.sysman.core.security.auth.is_external_authentication_enabled=null
oracle.sysman.core.security.auth.ldapuserattributes_emuserattributes_mappings=null
oracle.sysman.core.security.auth.redirect_to_canonicalUrl=false
oracle.sysman.core.security.sso.logout_url=null
oracle.sysman.core.security.sso.type=null
oracle.sysman.core.trace.dumpInterval=15
oracle.sysman.core.trace.enableTrace=true
oracle.sysman.core.trace.enableUIPerfTrace=true
oracle.sysman.core.trace.maxTraceRecords=50
oracle.sysman.core.trace.uiPerfTraceThreshold=30
oracle.sysman.core.uifwk.PublicServletEnabled=true
oracle.sysman.core.uifwk.complianceText=null
oracle.sysman.core.uifwk.maxRows=2000
oracle.sysman.core.uifwk.realTimeUIEnabled=true
oracle.sysman.db.onlyDiscoverCrsManagedTargets=false
oracle.sysman.emRep.repositoryMode=repository
oracle.sysman.emSDK.sec.DirectoryAuthenticationType=null
oracle.sysman.emSDK.sec.eus.DASHostUrl=null
oracle.sysman.emSDK.sec.eus.Domain=null
oracle.sysman.emSDK.svlt.ConsoleSLBUploadHTTPSPort=null
oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=4903
oracle.sysman.emSDK.svlt.ConsoleServerHost=occprod
oracle.sysman.emSDK.svlt.ConsoleServerName=occprod:4889_Management_Service
oracle.sysman.emSDK.svlt.ConsoleServerPort=4889
oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort=7803
oracle.sysman.emSDK.svlt.EMConsoleServerPort=7788
oracle.sysman.emSDK.svlt.SLBEMConsoleHTTPSPort=null
oracle.sysman.emSDK.svlt.SLBHost=null
oracle.sysman.emSDK.svlt.SLBJVMDHTTPPort=-1
oracle.sysman.emSDK.svlt.SLBJVMDHTTPSPort=-1
oracle.sysman.emas.JMXSSHLocalPort=null
oracle.sysman.emas.MWHeatMapTargetLimit=2000
oracle.sysman.emas.MWTableTargetLimit=2000
oracle.sysman.emas.wsmgt.http.proxyHost=null
oracle.sysman.emas.wsmgt.http.proxyPort=null
oracle.sysman.secure.comm.EMConsoleLocked=true
oracle.sysman.secure.comm.UploadLocked=true
use_pooled_target_connections=true
-bash-4.2$
禁用BI Publisher(emctl config oms -disable_bip)
在安装13c时,我们可以选择安装BI Publisher。如果暂时不用我们可以先禁用他,这样可以减少系统启动时间,减少对系统的压力。当需要时,可以再将她打开。
BI Publisher Server Information
BI Publisher Managed Server Name: BIP
BI Publisher Server is Up
BI Publisher HTTP Managed Server Port : 9701
BI Publisher HTTPS Managed Server Port : 9803
BI Publisher HTTP OHS Port : 9788
BI Publisher HTTPS OHS Port : 9851
BI Publisher is locked.
BI Publisher Server named 'BIP' running at URL: https://occprod:9851/xmlpserver
BI Publisher Server Logs: /pemrep/fmw/gc_inst/user_projects/domains/GCDomain/servers/BIP/logs/
BI Publisher Log : /pemrep/fmw/gc_inst/user_projects/domains/GCDomain/servers/BIP/logs/bipublisher/bipublisher.log
Oracle Enterprise Manager Cloud Control 13c Release 1
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
Stopping BI Publisher Server...
Node Manager Not Running
BI Publisher Server is Down
BI Publisher has been disabled on this host and will not be started with the 'emctl start oms' or 'emctl start oms -bip_only' commands.
Overall result of operations: SUCCESS
-bash-4.2$