Page 3 - About This Document
Table of Contents About This Document ....................................................................................................... 11 1 Diagnostic and Monitoring Tools and Options ........................................................ 13 1.1 HP-UX Java Tools and Options Tables.............
Page 7 - List of Figures
List of Figures 1-1 HPjconfig - System Tab..................................................................................................................22 1-2 HPjconfig - Application Tab..........................................................................................................22 1...
Page 9 - List of Tables
List of Tables 1-1 Tools and Options for Crash Analysis...........................................................................................13 1-2 Tools and Options for Debugging Hung and Deadlocked Processes...........................................14 1-3 Options for Fatal Error Handling.......
Page 11 - Intended Audience; Command; Ctrl; ENVIRONMENT VARIABLE; Key; Variable
About This Document The information in this document will help application developers and support engineers debugtheir Java applications on HP-UX systems. Intended Audience This document is intended for application developers and support engineers who are debuggingJava applications on HP-UX systems....
Page 12 - Related Information; Troubleshooting Guide for Java SE 6 with HotSpot VM; Publishing History; HP Encourages Your Comments
{} The contents are required in syntax. If the contents are a listseparated by |, you must choose one of the items. ... The previous element can be repeated an arbitrary number oftimes.Indicates the continuation of a code example. | Separates items in a list of choices. WARNING A warning calls atten...
Page 13 - Diagnostic and Monitoring Tools and Options; Table 1-1 Tools and Options for Crash Analysis
1 Diagnostic and Monitoring Tools and Options This chapter describes the tools and options available for postmortem diagnostics, analysis ofhung/deadlocked processes, monitoring memory usage, and performance monitoring. The tools and options are listed in tables by their respective functions in the ...
Page 16 - causes the process with id to print a thread dump to its
1.1.7 JDK Tools Not Available on HP-UX Some JDK tools are not available on HP-UX, so they are not described in this document. Theyare provided in JavaSoft JDK as unsupported tools. Equivalent functionality is available via gdb Java support, HPjmeter , and the HeapDump options. Table 1-7 JDK Tools No...
Page 18 - gcore; process-id. The process information in the core image can be
1.4 gcore The gcore command creates a core image of a running process. By default, the name of the core file for a process-id will be core. process-id. The process information in the core image can be obtained by using gdb or other debuggers. When gcore creates a core image of each specified process...
Page 19 - gdb; gdb
Additionally, this is how you set the environment variable on an Integrity machine for a 32–bitJava application: export GDB_JAVA_UNWINDLIB=/opt/java1.4/jre/lib/IA64N/server/libjunwind.so If the SDK is installed in a location other than the default, substitute the non-default location for /opt/java1....
Page 21 - HPjconfig
If the Java and system libraries used by the failed application reside in non-standard locations,then the GDB_SHLIB_PATH environment variable must be set to specify the location of the libraries. The following example illustrate how to invoke gdb on a hung process: • Determine the process id: $ ps -...
Page 24 - HPjmeter
maxfiles 2*1024maxfiles_lim 2*1024maxdsiz 2000*1024*1024 Following is an example of using HPjconfig to display tunables that are set to values less than those recommended: $ java -jar HPjconfig.jar -nogui -tunables -listmisLog written to HPjconfig_mutant_20060915_040955.logList of tunables whose val...
Page 25 - The
Table 1-11 HPjmeter 3.0 Features Drill down into application profile metrics• Graphic display of profiling data• Call graphs with call count, or with CPU or clock time• Per thread display of time spent• Per thread or per process display Integrated HPjtune functions with concurrent improvements in to...
Page 28 - Garbage Collection Analysis
1.7.1.2 Using HPjmeter to Analyze Garbage Collection Data The following steps summarize how to use HPjmeter to save and view garbage collection information from your applications: 1. Change the command line of your Java application to use -Xverbosegc or -Xloggc to capture garbage collection data. 2....
Page 35 - Thread Histogram; HPjtune
Figure 1-14 HPjmeter - Thread Histogram 1.8 HPjtune NOTE: The HPjtune product has reached end of life. HP has integrated HPjtune functionality into HPjmeter 3.0 and recommends migrating to HPjmeter for the latest in bug fixes, enhancements, and support. HPjtune is a garbage collection visualization ...
Page 36 - Screen; hat; jhat; hprof
Following is an example screen shot to illustrate HPjtune 's output: Figure 1-15 HPjtune Screen 1.9 hat NOTE: Beginning with JDK 6.0, hat is replaced with jhat . For information on jhat , refer to the jhat section in this document. The hat tool is a third-party tool that can be used for heap analysi...
Page 38 - jconsole
environment variable may be useful to add options to the command line when the applicationis run. This environment variable is primarily intended to support the initialization of tools,specifically the launching of native or Java agents using the -agentlib or -javaagent options. The JAVA_TOOL_OPTION...
Page 39 - jdb
$ /opt/java1.5/bin/jconsole 13028 The following figure shows a jconsole screen shot: Figure 1-16 jconsole Screen jconsole can also be run remotely. To learn more about jconsole , including remote invocation, refer to the following website: http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsol...
Page 40 - jstat; Table 1-13 Options to the
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html 1.16 jps (1.5+ only) The jps tool lists the Java VMs on the target system. The tool is limited to reporting information on Java VMs that the user has access rights to, as determined by HP-UX specific access controlmechanisms. For exam...
Page 41 - jstatd
Table 1-13 Options to the jstat Command (continued) Prints statistics of the sizes of the old generation -gcoldcapacity Prints statistics of the sizes of the permanent generation -gcpermcapacity Prints a summary of garbage collection statistics -gcutil Prints Java compilation method statistics -prin...
Page 42 - visualgc
As of JDK 1.5, the following subset of jvmstat tools is included with the JDK: jps (formerly jvmps ) , jstat (formerly jvmstat ), and jstatd (formerly perfagent ). The visualgc tool is not included with JDK 1.5+, but is instead provided in the unbundled jvmstat 3.0 distribution. For more details, re...
Page 47 - Table 1-15 Garbage Collection Field Information
Table 1-15 Garbage Collection Field Information (continued) Information in Field Field Eden Sub-space (within the New Generation) occupied after GC. 8 Eden Sub-space (within the New Generation) current capacity. 9 Survivor Sub-space (within the New Generation) occupied before GC. 10 Survivor Sub-spa...
Page 48 - stdout
1.27 -XX:+HeapDump and _JAVA_HEAPDUMP Environment Variable The -XX:+HeapDump option can be used to observe memory allocation in a running Java application by taking snapshots of the heap over time. Another way to get heap dumps is to usethe _JAVA_HEAPDUMP environment variable; setting this environme...
Page 49 - Using Heap Dumps to Monitor Memory Usage
example, the following file names are created: java_27298.hprof.1152743593943 and java_27298_060712_153313_heapDump.hprof.txt . If JAVA_BINARY_HEAPDUMP is set and the -Xrunhprof:heap=dump command is given, then both hprof ASCII and binary files are produced for this option. 1.27.3 -XX:+HeapDumpOnOut...
Page 51 - Useful System Tools for Java Troubleshooting; tusc
2 Useful System Tools for Java Troubleshooting This chapter contains information about some system tools available on HP-UX that are usefulwhen troubleshooting Java application problems. The tools discussed include: GlancePlus , tusc , Prospect , HP Caliper , sar , vmstat , iostat , swapinfo , top ,...
Page 52 - swapinfo; top; netstat
2.8 swapinfo The swapinfo command displays information about device and file system paging space. For more information on this command, refer to the following website: http://docs.hp.com/en/B2355-60127/swapinfo.1M.html 2.9 top The top command displays the top processes on the system, periodically up...
Page 53 - Getting Help from Hewlett-Packard
3 Getting Help from Hewlett-Packard Sometimes you need help troubleshooting your Java application problems. Before opening asupport call, search for information that may help you by referring to the Go Java! website: http://www.hp.com/go/java This site contains much information about Java, including...
Page 54 - Collecting Problem Data
a. What is the version of the Java VM that is having the problem? Run the command java -version to retrieve this information. b. What are the values of the environment variables used by Java? c. What libraries are being loaded? This information is best collected with gdb 's packcore command. 5. Cont...
Page 56 - Collecting Fatal Error Log Information
3.2.1.1.5 Ensure Permissions Allow Core Files Some Java processes run setuid; that is, a process where the effective uid or gid differs from thereal uid or gid. On HP–UX 11.11 and later versions a kernel security feature prevents core filecreation for these processes. Use the following command when ...
Page 58 - Collecting System Information; Collecting Java Environment Information
3.3 Collecting System Information Along with HP-UX version information and information about which window manager is beingused, it is also useful to know which patches are installed on the system. This information canbe gathered either with swlist or HPjconfig . Following is an example using the swl...
Page 60 - Library Location for PA-RISC Systems; Library Location for Integrity Systems
Table 3-1 Libjunwind Library Location for PA-RISC Systems libjunwind Location Application Type /opt/<java_vers>/jre/lib/PA_RISC/server/libjunwind.sl PA1.1 applications ( java -pa11 ) /opt/<java_vers>/jre/lib/PA_RISC2.0/server/libjunwind.sl PA2.0 32–bit applications (defaultPA-RISC) /opt/...
Page 61 - Core File Analysis; core; StackTrace; StackTraceJob
4 Core File Analysis The previous chapter described how to collect necessary information before opening a call toHP Support to get help troubleshooting Java applications. Sometimes it is possible to at leastattempt the core file analysis on your own. This chapter walks through an example core filean...
Page 62 - If this script is run on an Integrity system, change it from:
/usr/bin/echo "Create header file"javah -verbose -jni StackTrace # compile jni code/usr/bin/echo "Compile c code"/usr/bin/cc +z -c -I $JAVA_HOME/include \ -I $JAVA_HOME/include/hp-ux stacktrace.c # create shared library/usr/bin/echo "Create shared library"/usr/bin/ld -b -o li...
Page 64 - Building the Application
"(I)Ljava/lang/String;"); (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); if(methodid == NULL) { return (*env)->NewStringUTF(env, "JNI GetStaticMethodID failed!"); } return (*env)->CallStaticObjectMethod(env, classid, methodid, intarg); } 4.2 Building the App...
Page 65 - Debugging On Same System; “Packaging Files For Debugging On Different System”; Packaging Files For Debugging On Different System
• libstacktrace.sl —the runtime library • stacktrace.o —the object file 4.3 Verify Core File Before you proceed further, verify that the core file, core , is complete and valid. You can do this in two steps. First, open the file in gdb and check the error and warning messages. $ gdb /opt/java1.4/bin...
Page 66 - Unpacking Files On Debugging System
• All source files ( .java , .h , .c ). • All .class files. • The command line used to run the application program. In this example, the StackTraceJob script. Now, use gdb to pack the core file. $ gdb /opt/java1.4/bin/PA_RISC2.0/java core HP gdb 5.5.7 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00 and...
Page 68 - Collecting Fatal Error Log Information
4.7 Example gdb Session Before beginning core file analysis, examine the fatal error log file, hs_err_pid<pid>.log . This file contains useful information that will help you troubleshoot the problem. For moreinformation about the contents of the hs_err_pid<pid>.log file, refer to Section...
Page 70 - frame9instrs
You want to display 75 instructions from the beginning of the get_method_id() function to the point of failure for frame 9. Since this is a substantial number of instructions, redirect theoutput to a file: (gdb) set redirect-file frame9instrs(gdb) set redirect onRedirecting output to frame9instrs.(g...
Page 75 - Glossary
Glossary GC Garbage collection. gid Group id. HotSpot VM The JDK comes with a virtual machine implementation called the Java HotSpot VM. Java VM On HP implementations this is the same as the HotSpot VM. JDK The Java Developer's Kit is the set of Java development tools consisting of the API classes, ...
Page 77 - Index; Symbols
Index Symbols -verbose:class , 42 -verbose:gc , 42 -verbose:jni , 42 -Xcheck:jni , 45 -Xverbosegc , 46 -XX:+HeapDump , 48 -XX:+HeapDumpOnCtrlBreak , 48 -XX:+HeapDumpOnly , 49 -XX:+HeapDumpOnOutOfMemoryError , 49 -XX:+ShowMessageBoxOnError , 50 -XX:ErrorFile , 47 -XX:OnError , 49 _JAVA_HEAPDUMP envir...