Saturday, March 23, 2013

Tuning JVM heap size in E-business Suite

Many time we face the performance issue in e-business suite, specially in mid-tier. And most of the time the issue is memory. JVM fall short of memory. This post will demonstrate you about how to increase the JVM memory in middle tier.
If some one ask you a question as an APPS DBA, where will you change if you want to change the memory sizing in middle tier. Without even thinking we should say CONTEXT FILE. Thats right !!! Every thing in middle tier is controlled by CONTEXT FILE.
E-Business suite has some standard values for JVM memory that it set when you clone the instance. You can see the memory values in CONTEXT FILE as given below.
Checking the current memory sizing for mid-tier
We have following variables defined in CONTEXT FILE which defines the memory allocation to different components of application.
s_forms_jvm_start_options -> For defining memory allocation for forms.
We will have 2 elements defined for forms: forms_jvm_start_options and forms_jvm_stop_options
<forms_jvm_start_options oa_var="s_forms_jvm_start_options">-server -verbose:gc -Xmx256M -Xms64M -XX:MaxPermSize=128M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false</forms_jvm_start_options>
<forms_jvm_stop_options oa_var="s_forms_jvm_stop_options">-server -verbose:gc -Xmx256M -Xms64M -XX:MaxPermSize=128M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false</forms_jvm_stop_options>
-Xmx256M -> this mean maximum heap size is 256MB
-Xms64M  -> this mean initial heap size is 64MB
-XX:MaxPermSize -> specifies the the maximum size for the permanent generation heap
Similarly we have the following variables as well for oacore and oafm, each having start_options and stop_options
s_oacore_jvm_start_options -> For defining memory allocation for oacore.
s_oafm_jvm_start_options   -> For defining memory allocation for oafm.
The above setup if for increasing the JVM size for 1 JVM. You can also increase the number of JVM processes as well.
-bash-3.00$ grep nproc $CONTEXT_FILE
<frmsrv_nprocs oa_var=”s_frmsrv_nprocs”>1</frmsrv_nprocs>
<forms_nprocs oa_var=”s_forms_nprocs”>2</forms_nprocs>
<oacore_nprocs oa_var=”s_oacore_nprocs”>2</oacore_nprocs>
<oafm_nprocs oa_var=”s_oafm_nprocs”>1</oafm_nprocs>
If you see here we have nproc (number of JVM processes) defined for each of the component. We can even change number of JVM processes for each component. How to change these settings … keep reading !!!
Changing the JVM memory size
When you are changing the memory size, once cannot just increase the memory size. One needs to check what is the current physical memory available on this system. System I mean to say the host. Also one should see, how many environments are running on that host. Depending on these factors, you need to come up with memory available to your host.
Example in my case I have a host with 8GB RAM. I have 2 environments available on this host. So that gives me 4GB RAM for each instance (Assuming that both the instances are of similar type).
So out of 4GM of physical RAM memory, I will need 1GB for database (my SGA_TARGET is set to 1G).
We are now left with 3GB of RAM memory. Most of the issues and processing goes with oacore. So its a good idea to concentrate more on oacore and then on forms.
We can set -Xmx for s_oacore_jvm_start_options to 1024 and -Xms & -XX:MaxPermSize to 256M. That mean 1 JVM process for oacore will not consume 1G memory. We have defined 2 processes for oacore (s_oacore_nprocs parameter). So for oacore we have allocated 2G memory. We are not left with 1G memory.
Forms having max heap size (-Xmx256M) 256MB and 2 processes defined for the same. Thats makes 512MB if memory for forms. So remaining 512MB can be allocated to oafm process.
Exmaple s_oacore_jvm_start_options will look as given below.
<oacore_jvm_start_options oa_var="s_oacore_jvm_start_options">-server -verbose:gc -Xmx1024M -Xms256M -XX:MaxPermSize=256M -XX:NewRatio=2  -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC  -XX:ParallelGCThreads=2$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false</oacore_jvm_start_options>
Once you make the changes in context file, run autoconfig. This will configure the memory sizing for mid-tier.
Metalink note ID: 362851.1, 567551.1 & 472781.1

1 comment:

  1. Nice Post ... As we move ahead in learning bigger things in Oracle EBS, we tend to forget the basics. Good Explanation.