Tuesday, February 7, 2012

How to increase heap size in 64 bit machine OC4J Container?

In 64 bit machine you can increase the heap size to about 2^64. To increase the heap size in 64 bit JVM, the processor and operating system should also have 64 bit type to support almost unlimited heap size.

Note: The heap size should be kept at optimum size, even though it supports huge allocation. Performance will be degraded if you allocate more heap. Its better to use half the size of RAM as your heap size.

How to determine the maximum heap that can be allocated for your JVM?

Use the command "java -d64 -mx10g -version", if your JVM supports 64 bit you will get the jdk version otherwise you will get "Unrecognized option: -d64" message.

$ java -d64 -mx15g -version
java version "1.5.0.16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.16-_09_mar_2009_04_02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0.16 jinteg:03.09.09-12:27 IA64W, mixed mode)

$ java -d64 -mx1024g -version
java version "1.5.0.16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0.16-_09_mar_2009_04_02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0.16 jinteg:03.09.09-12:27 IA64W, mixed mode)

How to change the heap size in OC4J container?

Take a backup of opmn.xml and edit the opmn.xml at location $ORACLE_HOME/opmn/conf.

Edit the startParameters of your container and add "-d64 -ms10g -mx10g" in value of 'java-options' to increase the heap size to 10GB

<category id="start-parameters">
<data id="java-options" value="-server -d64 -ms10g -mx10g -XX:MaxPermSize=512M -XX:AppendRatio=3 -Djava.security.policy=$ORACLE_HOME/j2ee/oc4j_soa/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doraesb.home=$ORACLE_HOME/integration/esb -Dhttp.proxySet=false -Doc4j.userThreads=true -Doracle.mdb.fastUndeploy=60 -Doc4j.formauth.redirect=true -Djava.net.preferIPv4Stack=true -Dorabpel.home=$ORACLE_HOME/bpel -Xbootclasspath^/p:$ORACLE_HOME/bpel/lib/orabpel-boot.jar -Dhttp.proxySet=false -XX:MaxNewSize=614m -XX:NewSize=614m -XX:SurvivorRatio=6 -Daia.home=$AIA_HOME/AIA -Dbpel.delivery.operationNameCheck=true -Dbpel.dms=false" />
</category>

No comments:

Post a Comment