This document provides information about correlating a PID
from top output to a thread in a javacore file. The following
example data was gathered as per Mustgather:
100% CPU usage on Linux when the JVM is consuming high CPU.
The following sample top output is for a high CPU condition:
PID USER PRI NI SIZE RSS SHARhey PatE STAT %CPU %MEM
TIME COMMAND
19099 root 25 0 433M 433M 48484
R 99.9 12.3 20:07 /opt/Web...
19440 root 15 0 2160 2156 1500 R 1.9
0.0 0:00 top
1 root 15 0 512 512 444
S 0.0 0.0 0:04 init
From the sample top output, you can see that PID
"19099" is utilizing 99.9% of the CPU. Locate the
javacore file that was generated at the same time asyour top
output. To find the thread, perform a search within the javacore
file for the PID showing high utilization of the CPU. In this example it
would be PID "19099".
Following is an extraction example from the javacore file that
was collected at the same time as the top output:
"Thread-1161" (TID:0x16510C18,
sys_thread_t:0x51E78568, state:R, native ID:0x51B437) prio=5
at java.io.RandomAccessFile.read
at java.io.RandomAccessFile.readInt
at
jet.connect.DbStringColumnBuffer.readValueFromFile
at jet.connect.DbColumnBuffer.readFromFile
at jet.connect.DbPage.read
at jet.connect.DbPage.readFromFile
at jet.connect.DbBuffer.$GQ
at jet.connect.DbBuffer.getPageOfTheRow
at jet.connect.DbBuffer.refreshRecord
at jet.connect.DbRecord.refresh
at jet.connect.jdbms.JDbResultSet.nextRecord
at jet.server.schedule.CompletedTable.
getCompletedTaskRecordsByTaskID
at jet.server.jrserver.JRCompletedTaskTable.
getCompletedTaskRecordsByTaskID
at cats.rpt.JREntThread.updateTaskStatus
at cats.rpt.JREntThread.run
Native Stack of
""Thread-1161"" PID 19099
-------------------------
pthread_sigmask at 4002A136 in
libpthread.so.0
sysRead at 4038F041 in libhpi.so
JVM_Read at 4024EBBE in libjvm.so
readSingle at 403C614D in libjava.so
Java_java_io_RandomAccessFile_read at 403C5678 in
libjava.so 457214B5
From this extraction, it is evident that
"Thread-1161" is the cause for high CPU. You
can now review the stack for the previous thread to find the cause of the
problem.
|