Showing posts with label OC4J. Show all posts
Showing posts with label OC4J. Show all posts

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>

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

java.lang.OutOfMemoryError occurs after complete utilization of heap memory.

In 32bit machine you can increase the heap approximately to 2GB. This also varies depending on various parameters like the size of RAM, Operating System etc.,

Generally in Windows machine half the RAM capacity will be used by the System and remaining by the applications. Configuration can be changed to reduce the system memory usage in Windows machine.

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

Use the command "java -mx2048m -version", if your JVM supports given memory size you will get the JDK version message otherwise you will receive Invalid maximum heap size message.

$ java -mx3072m -version
java version "1.6.0.06"
Java(TM) SE Runtime Environment (build 1.6.0.06-jinteg_20_jan_2010_05_50-b00)
Java HotSpot(TM) Server VM (build 14.3-b01-jre1.6.0.06-rc1, mixed mode)


$ java -mx4096m -version
Invalid maximum heap size: -Xmx4096m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.


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 "-ms3072M -mx3072M" in value of 'java-options' to increase the heap size to 3GB

<category id="start-parameters">
<data id="java-options" value="-server -ms3072M -mx3072M -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=t
rue -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>