Question & Answer
Question
IBM Java for AIX MustGather: Data collection procedure for slow or hung Java process in UnixFileSystem.getBooleanAttributes() method
Answer
Collecting and uploading this information at the time the IBM support call is opened, will help expedite the resolution of the issue being reported.
Generic Term | Replace with |
USERID | The AIX userid running the Java process (e.g. wasadmin or root). |
TMP_PATH | A temporary directory with a minimum of 10 GB of free space (e.g. /large_fs). |
MM-DD | The current month and day (e.g. ,01-31). |
PMR | The full IBM PMR number (e.g. , PMR12345.b678.c000). |
JAVA_PATH | The parent Java installation directory (e.g. /usr/java6 or /usr/java7_64). |
JAVA_PID | The process id of the active Java process (e.g. use "ps" command to check the PID column to identify the process). |
START_PATH | The directory, from which the Java process was started (e.g. /usr/IBM/WebSphere. |
SPECIFIC_PATH | User specified directory(e.g./tmp). |
When the active Java process is slow or hung while performing file/directory operations over files residing on a local/NFS file system, the java process could be consuming high CPU and the process threads consuming the CPU have thread stacks that are similar to:
at java/io/UnixFileSystem.getBooleanAttributes0(Native Method)
at java/io/UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:254(Compiled Code))
at java/io/File.isDirectory(File.java:855(Compiled Code))
................
or
at java/io/UnixFileSystem.getBooleanAttributes0(Native Method)
at java/io/UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:239(Compiled Code))
at java/io/File.exists(File.java:744(Compiled Code))
................
To confirm this scenario, run the following command and look under the 'CP' column(gives % of CPU consumed on the system) in the output to determine which threads are using high CPU time:
# ps -mp JAVA_PID -o THREAD
If you see small number of threads consuming high CPU, note their thread ids under the 'TID' column of the output and convert them into hexadecimal values.
Generate a thread dump(javacore.*.txt) by issuing the 'kill -3 JAVA PID' command, which does not kill the process, but only generates a thread dump. Now, search for the above high CPU consuming threads in the thread dump(javacore.*.txt) generated, using the hexadecimal value of their thread ids.
The issue is confirmed if the Java call stacks for those threads are similar to the thread stacks shown above with the method, java/io/UnixFileSystem.getBooleanAttributes0(Native Method), at the top of the stack.
A. Download the "pdump" shell script
The pdump shell script can be downloaded from the FTP site:
ftp://ftp.software.ibm.com/aix/tools/debug/pdump.sh
Copy the downloaded file to the AIX system using the filename:
/opt/pdump/pdump.sh
From a command prompt, execute the following command to change the permissions on this file:
# chmod 755 /opt/pdump/pdump.sh
B. Enable the system and the user environment for full core dumps
From a command prompt, while logged in as the root user, execute the following commands to enable full core dumps for the system and process environment.
# chdev -l sys0 -a fullcore=true
# chuser fsize=-1 data=-1 core=-1 USERID
C. Redirect or save standard error (stderr) messages to a file
Commonly used application servers may already save standard out and standard error messages to a log file (e.g., SystemOut.log native_stdout.log, SystemErr.log, native_stderr.log) or to the application log file.
For custom applications, redirect the standard error messages by appending "2>&LOG_FILE" or to redirect both the stdout and stderr to a file append ">LOG_FILE 2>&1".
D. Relogin, then restart your application
Perform the following actions inorder for the changes to take effect:
- Stop the application (and node agent/manager, if applicable)
- Relogin as the USERID used in Step B above
- Confirm that full core is enabled and the new ulimits are in effect:
# ulimit -a
# lsattr -El sys0 | grep -i fullcore
# mkdir -p /TMP_PATH/PMR/MM-DD/trace
# mkdir -p /TMP_PATH/PMR/MM-DD/data
# mkdir -p /TMP_PATH/PMR/MM-DD/iptrace
Enable manual generation of javacores and snap traces by adding the command line option:
-Xdump:java+snap:events=user
To designate a directory for the generated logs, instead of the default directory, add the command line option:
-Xdump:directory=SPECIFIC_PATH
Restart the java application (e.g., node agent/manager) from the USERID new login session. Once the application reaches a steady state, enable truss by running the following command :
# truss -aelfdo > /TMP_PATH/PMR/MM-DD/data/truss.out -p JAVA_PID
To start the iptrace, run the following command:
# startsrc -s iptrace -a "/TMP_PATH/PMR/MM-DD/iptrace"
Immediately once the process hang or slowness can be reproduced, from a command prompt, and while logged in as the root user, execute the following commands to collect the required diagnostic data:
# stopsrc -s iptrace
# cd /TMP_PATH/PMR/MM-DD/data
# gencore JAVA_PID core.dmp
# sleep 5
# kill -3 JAVA_PID
# sleep 5
# kill -3 JAVA_PID
# sleep 5
# kill -3 JAVA_PID
# cd /TMP_PATH/PMR/MM-DD/trace
# trace.sh 10
# cd /TMP_PATH/PMR/MM-DD/data
# /opt/pdump/pdump.sh JAVA_PID
Stop 'truss' that was enabled for the java process.
# prtconf > prtconf.out 2>&1
# lslpp -hac > lslpp-hac.out 2>&1
# errpt -a > errpt-a.out 2>&1
{Copy the application logs to the data directory.}
{Copy the stderr/stdout files to the data directory.}
# JAVA_PATH/jre/bin/jextract START_PATH/core.dmp
Prior to packaging and uploading the data, confirm that the following files have been saved in the "/TMP_PATH/MM-DD/UnsatisfiedLinkError/data directory:
a. Javacore files
b. Snap traces
c. Truss output
d. Trace data
e. pdump data
f. core.dmp.zip (jextracted) or snapcore file (mandatory)
g. AIX commands output
h. standard error, standard output, SystemOut, SystemErr, application logs and any other logs generated.
Packaging the files may simplify the upload of the diagnostic data collected. From the command line and while logged in as the root user, execute the commands:
# cd /TMP_PATH/PMR/MM-DD
# tar -cf - data trace iptrace | gzip -c > PMR.MM-DD.tgz
If you do not correctly replace the Generic Terms in the file name with the actual PMR # and date, there will be a delay in both the review of the data and the resolution of this issue.
Upload the packaged data to IBM secured servers using one of upload options provided on the "IBM Java for AIX MustGather: How to upload diagnostic data and testcases to IBM" web page:
http://www-01.ibm.com/support/docview.wss?uid=isg3T1022619
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
ACTION
Document Type: | Instruction |
Content Type: | Mustgather |
Hardware: | all Power |
Operating System: | all AIX Versions |
IBM Java: | all Java Versions |
Author(s): | Vidya Makineedi |
Reviewer(s): | Rama Tenjarla |
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
isg3T1024991