Search This Blog

Thursday, October 19, 2006

High CPU Usage Java

Add this variable to opmn.xml file

ias-instance id="j2ee2.asdtbde.idc.oracle.com"
environment
variable id="TMP" value="/tmp"
variable id="LD_ASSUME_KERNEL" value="2.4.1"
variable



Find out the java process using the command
opmnctl status
and not down the PID

opmnctl status

Processes in Instance: j2ee2.asdtbde.idc.oracle.com
-------------------+--------------------+---------+---------
ias-component | process-type | pid | status
-------------------+--------------------+---------+---------
DSA | DSA | N/A | Down
LogLoader | logloaderd | N/A | Down
dcm-daemon | dcm-daemon | N/A | Down
OC4J | home | 28370 | Alive
WebCache | WebCache | 28380 | Alive
WebCache | WebCacheAdmin | 28371 | Alive
HTTP_Server | HTTP_Server | 28373 | Alive

Use this command to find out the actual process ID , In this case the actual java process is ,
28377.

ps -ef | grep 28370
rac 28370 28354 0 11:23 ? 00:00:01 /home/rac/j2ee2/jdk/bin/java
rac 28377 28370 0 11:23 ? 00:00:00 /home/rac/j2ee2/jdk/bin/java

Run the command ,

watch "ps -eLo pid,ppid,tid,pcpu,comm | grep 28377"

Find out the therad ID which taking lot of CPU time ,
i.e it should be there in the first column

Now take the thread dump

kill -3 28370 (process-id-from-opmn-status-output)

Convert the Thread ID you got from the command ,
ps -eLo pid,ppid,tid,pcpu,comm | grep 28377
hexadecimal and then search for this value in the thread dump.

For the JDK 5.0 you do not need to the LD_ASSUME_KERNEL etc.

Please also check the Article

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18339

No comments: