Skip to main content

JVM Performance tuning with 11i

Following are the questions answered to one of the mailing lists. Here it is shared.....

Usually Performance issues with JVM's are related either to,

1. JDK Bugs
2. JVM thread deadlocks and memory leaks 3. Application request taking too long to process ex. long running query, poor sql, db issues or java coding 4. Poor performing Garbage collection
5. Incorrect JVM startup settings

The amount of memory that should be allocated to each JVM depends on the number of JVM's, the number of users on the system, the amount of physical memory on the middle tiers, the habits of the users and the version of the JDK used by the system. THe version of JDK being used makes a large difference to how the memory and the number of JVM's should be sized. JDK 1.3 performs better with more JVM's and less heap while JDK 1.4/1.5 performs better when there are less JVM's and more heap. Thumb rule is to have 1JVM per 2 cpu's with increased heap parameter for better performance. As a minimum 1JVM per CPU can be used.
So now you know why the crash has gone after the new changes on JVM. JVM always uses native threads to execute requests and parallel garbage collection will spawn as many threads as CPU's. GC is not parallel that is GC cannot be parallel for a single JVM but parallelism happens only when there are more than 1 JVM, so having 1JVM per 2 CPU's helps to a larger extent. This answers your question on parallel GC

(Q3). Some tips for tuning.
1. Make sure that there are not FULL GC happening very often. 2. Use OAM to track memory usage and GC 3. Use IAS_ORACLE_HOME/Apache/Jserv/logs/jvm/OACoreGroup.x.stdout to determine how often GC is occuring. Here x in the file name is the JVM number starts with 0. 4. Use debug JVM options to obtain extra information regarding Heap Performance

To know what objects are using up memory as well as how much memory is freed after the first call to the garbage collection, use Java Profile on top of the JVM. Example OptimizeIt, HPJMeter, JProbe, JVMStat, Visualgc. This answers your question on how to find the module using high JVM(Q1). Following are few links for the tools mentioned above:
http://www.quest.com/jprobe/ http://developers.sun.com/dev/coolstuff/jvmstat http://java.sun.com/performance/jvmstat/visualgc.html Once the object/code is identified, if it is a standard Oracle Apps code then you need to log a bug with Oracle Development else if its a custom object then fire the customer for it. This answers your question2. JDK 1.5 gives over 40% higher performance over JDK 1.4. So higher the version of JDK better is the performance. Ask your customer to upgrade the JDK. Hope my few cents help.

Comments

Popular posts from this blog

SQL Interview Questions on Subqueries

SUB Queries:
1. List the employees working in research department 2. List employees who are located in New York and Chicago
3. Display the department name in which ANALYSTS are working
4. Display employees who are reporting to JONES
5. Display all the employees who are reporting to Jones Manager
6. Display all the managers in SALES and ACCOUNTING department
7. Display all the employee names in Research and Sales Department who are having at least 1 person reporting to them
8. Display all employees who do not have any reportees
9. List employees who are having at least 2 reporting
10. List the department names which are having more than 5 employees
11. List department name having at-least 3 salesman
12. List employees from research and accounting having at-least 2 reporting
13. Display second max salary
14. Display 4th max salary
15. Display 5th max salary  -- Answer for nth Max Salary
Co-Related Subqueries:
16. Write a query to get 4th max salary from EMP table
17. Write a query to get 2nd…

Answers for SUB Queries

1. SQL> select empno, ename from emp where deptno=(select deptno from dept where dname='RESEARCH');


2. SQL> select empno, ename from emp where deptno in (select deptno from dept where loc in ('NEW YORK','CHICAGO'));

3. SQL> select dname from dept where deptno in ( select deptno from emp where job ='ANALYST');

4. SQL> select empno, ename, mgr from emp where mgr = (select empno from emp where ename='JONES');

5. SQL> select empno, ename, mgr from emp where mgr = (select mgr from emp where ename='JONES')

6. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','ACCOUNTING'))

7. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','RESEARCH')) and empno in (select mgr from emp)

8. SQL> select empno, ename from emp where empno not in ( select mgr from emp where mgr is not null)

9. select…

'Linux-x86_64 Error: 28: No space left on device' While trying to start the database -- Error

SQL> startup mount pfile='/tmp/initdlfasp12.ora'
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device


This as you can see is on Linux x86 with 64 bit processor. We got this error after we changed SGA on 10gR2 database. So was sure that this is something to do with the OS.

Parameters to check for this are shmall.

shmall is the total amount of shared memory, in pages, that the system can use at one time.

$cat /proc/sys/kernel/shmmax
53687091200

$ getconf PAGE_SIZE
4096

As per Oracle SHMALL should be set to the total amount of physical RAM divided by page size.

Our system has 64GB memory, so change kernel.shmall = 1024 * 1024 * 1024 * 64 / 4096 = 16777216


Once this value is calculated you can modify Linux system configuration file directly.

$ su - root
vi /etc/sysctl.conf file:
kernel.shmall=16777216

and

# sysctl -p

Once this is done the database was started without any problem.