Java Platform, Standard Edition Troubleshooting Guide

2016-12-30 09:53:47来源:oschina作者:nj-zhangmq人点击


Title and Copyright Information


Documentation Accessibility
Related Documents

Part I General Java Troubleshooting

1Prepare Java for Troubleshooting

1.1Set Up Java for Troubleshooting
1.2Enable Options/Flags for JVM Troubleshooting
1.3Gather Relevant Data

1.3.1Make a Java Application Easier to Debug

2Diagnostic Tools

2.1Diagnostic Tools Overview
2.2Java Mission Control

2.2.1Troubleshoot with Java Mission Control2.3What are Java Flight Recordings

2.3.1Types of Recordings2.4How to Produce a Flight Recording

2.4.1Use Java Mission Control to Produce a Flight Recording
2.4.2Use Startup Flags at the Command Line to Produce a Flight Recording
2.4.3Use Triggers for Automatic Recordings2.5Inspect a Flight Recording

2.5.1How to Get a Sample JFR to Inspect
2.5.2Range Navigator
2.5.3General Tab
2.5.4Memory Tab
2.5.5Code Tab
2.5.6Threads Tab
2.5.7I/O Tab
2.5.8System Tab
2.5.9Events Tab2.6The jcmd Utility

2.6.1Useful Commands for jcmd Utility
2.6.2Troubleshoot with jcmd Utility2.7Native Memory Tracking

2.7.1Use NMT to Detect a Memory Leak
2.7.2How to Monitor VM Internal Memory2.8HPROF

2.8.1Troubleshoot with HPROF Tool
2.8.2Heap Allocation Profile heap=sites
2.8.3Heap Dump Profile heap=dump
2.8.4CPU Usage Sampling Profile cpu=samples
2.8.5CPU Usage Times Profile cpu=times2.9JConsole

2.9.1Troubleshoot with JConsole Tool
2.9.2Monitor Local and Remote Applications with JConsole2.10Java VisualVM

2.10.1Troubleshoot with Java VisualVM2.11The jdb Utility

2.11.1Troubleshoot with jdb Utility
2.11.2Attach a Process
2.11.3Attach to a Core File on the Same Machine
2.11.4Attach to a Core File or a Hung Process from a Different Machine2.12The jhat Utility

2.12.1Troubleshoot with jhat Utility
2.12.2Standard Queries
2.12.3Custom Queries
2.12.4Heap Analysis Hints2.13The jinfo Utility

2.13.1Troubleshooting with jinfo Utility2.14The jmap Utility

2.14.1Heap Configuration and Usage
2.14.2Heap Histogram
2.14.3Permanent Generation Statistics2.15The jps Utility
2.16The jstack Utility

2.16.1Troubleshoot with jstack Utility
2.16.2Force a Stack Dump
2.16.3Stack Trace from a Core Dump
2.16.4Mixed Stack2.17The jstat Utility
2.18The visualgc Tool
2.19Control+Break Handler

2.19.1Thread Dump
2.19.2Detect Deadlocks
2.19.3Heap Summary2.20Native Operating System Tools

2.20.1DTrace Tool
2.20.2Probe Providers in Java HotSpot VM
2.20.3Improvements to pmap Tool
2.20.4Improvements to pstack Tool2.21Custom Diagnostic Tools

2.21.1Java Platform Debugger ArchitectureNMT Memory Categories
Postmortem Diagnostics Tools
Hung Processes Tools
Monitoring Tools
Other Tools, Options, Variables and Properties
The Package
The java.lang.instrument Package
The java.lang.Thread Class
JVM Tool Interface
The jrunscript Utility
The jsadebugd Daemon
The jstatd Daemon
Thread States for a Thread Dump
Troubleshooting Tools Based on Operating System

3Troubleshoot Memory Leaks

3.1Debug a Memory Leak Using Java Flight Recorder

3.1.1Detect a Memory Leak
3.1.2Find the Leaking Class
3.1.3Find the Leak3.2Understand the OutOfMemoryError Exception
3.3Troubleshoot a Crash Instead of OutOfMemoryError
3.4Diagnose Leaks in Java Language Code

3.4.1Create a Heap Dump
3.4.2Obtain a Heap Histogram
3.4.3Monitor the Objects Pending Finalization3.5Diagnose Leaks in Native Code

3.5.1Track All Memory Allocation and Free Calls
3.5.2Track All Memory Allocations in JNI Library
3.5.3Track Memory Allocation with Operating System Support
3.5.4Find Leaks with dbx Debugger
3.5.5Find Leaks with libumem Tool

4Troubleshoot Performance Issues Using JFR

4.1JFR Overhead
4.2Find Bottlenecks
4.3Garbage Collection Performance
4.4Synchronization Performance
4.5I/O Performance
4.6Code Execution Performance

Part II Debug JVM Issues 5Troubleshoot System Crashes

5.1Determine Where the Crash Occurred

5.1.1Crash in Native Code
5.1.2Crash in Compiled Code
5.1.3Crash in HotSpot Compiler Thread
5.1.4Crash in VM Thread
5.1.5Crash Due to Stack Overflow5.2Find a Workaround

5.2.1Working Around Crashes in the HotSpot Compiler Thread or Compiled Code
5.2.2Working Around Crashes during Garbage Collection
5.2.3Working Around Crashes Caused by Class Data Sharing5.3Microsoft Visual C++ Version Considerations

6Troubleshoot Process Hangs and Loops

6.1Diagnose a Loop Process
6.2Diagnose a Hung Process

6.2.1Deadlock Detected
6.2.2Deadlock Not Detected
6.2.3No Thread Dump6.3Oracle Solaris 8 Thread Library

7Handle Signals and Exceptions

7.1Handle Signals on Oracle Solaris and Linux
7.2Handle Exceptions on Windows
7.3Signal Chaining
7.4Handle Exceptions using Java HotSpot VM
Console Handlers
Signals Used in Oracle Solaris and Linux

Part III Debug Core Library Issues 8Time Zone Settings in the JRE

8.1Native Time Zone Information and the JRE

8.1.1Determine the Time Zone Data Version in Use
8.1.2Troubleshoot Problems with TZupdater8.2Determine the Default Time Zone on Windows

8.2.1Check the Default Time Zone JRE Reports
8.2.2Determine the Setting in the Control Panel
8.2.3Check for Automatic Daylight Saving Time Adjustment
8.2.4Set the Default Time Zone in the Control Panel
8.2.5Check -Duser.timezone System Property
8.2.6Special Tools in Windows 7
8.2.7JRE Internal Representation of Time Zone Mappings

Part IV Debug Client Issues 9Introduction to Client Issues

9.1Java SE Desktop Technologies
9.2General Steps to Troubleshoot an Issue
9.3Identify the Type of Issue

9.3.1Java Client Crashes
9.3.2Performance Problems
9.3.3Behavior Problems9.4Basic Tools


10.1Debug Tips for AWT
10.2Layout Manager Issues
10.3Key Events
10.4Modality Issues
10.5Memory Leaks
10.6AWT Crashes
10.7Focus Events

10.7.1How to Trace Focus Events
10.7.2Native Focus System
10.7.3Focus System in Java Plug-in
10.7.4Focus Models Supported by X Window Managers
10.7.5Miscellaneous Problems with Focus10.8Data Transfer

10.8.1Debug Drag and Drop Applications
10.8.2Frequent Issues with Data Transfer10.9Other Issues

10.9.1Splash Screen Issues
10.9.2Tray Icon Issues
10.9.3Popup Menu Issues
10.9.4Background/Foreground Color Inheritance
10.9.5AWT Panel Size Restriction
10.9.6Hangs during Debugging Popup Menus and Similar Components on X11
10.9.7Window.toFront()/toBack() Behavior on X1110.10Heavyweight/Lightweight Components Mix

11Java 2D Pipeline Rendering and Properties

11.1Oracle Solaris and Linux: X11 Pipeline

11.1.1X11 Pipeline Pixmaps Properties
11.1.2X11 Pipeline MIT Shared Memory Extension
11.1.3Oracle Solaris on SPARC: DGA Support
11.1.4Oracle Solaris on SPARC - Change Java 2D Default Visual11.2Windows OS - DirectDraw/GDI Pipeline
11.3Windows OS - Direct3D Pipeline in Full-Screen Mode
11.4OpenGL Pipeline in Oracle Solaris, Linux and Windows

11.4.1Enable OpenGL Pipeline
11.4.2Minimum Requirements
11.4.3Diagnose Startup Issues
11.4.4Diagnose Rendering and Performance IssuesLatest OpenGL Drivers

12Java 2D

12.1Generic Performance Issues

12.1.1Hardware Accelerated Rendering Primitives
12.1.2Primitive Tracing to Detect and Avoid Non-accelerated Rendering
12.1.3Causes of Poor Rendering Performance
12.1.4Improve Performance of Software-only Rendering12.2Text Related Issues

12.2.1Application Crash During Text Rendering
12.2.2Differences in Text Appearance
12.2.3Metrics12.3Java 2D Printing


13.1General Debug Tips for Swing
13.2Specific Debug Tips for Swing

13.2.1Incorrect Threading
13.2.2JComponent Children Overlap
13.2.3Display Update
13.2.4Model Change
13.2.5Add or Remove Components
13.2.6Opaque Override
13.2.7Permanent Changes to Graphics
13.2.8Custom Painting and Double Buffering
13.2.9Opaque Content Pane
13.2.10Renderer Call for Each Cell Performance
13.2.11Possible Leaks
13.2.12Mix Heavywight and Lightweight Components
13.2.13Use Synth
13.2.14Track Activity on Event Dispatch Thread
13.2.15Specify Default Layout Manager
13.2.16Listener Object Dispatched to Incorrect Component
13.2.17Add a Component to Content Pane
13.2.18Drag and Drop Support
13.2.19One Parent for a Component
13.2.20JFileChooser Issues with Windows Shortcuts


14.1Troubleshoot Internationalization and Localization

15Java Sound

15.1Troubleshoot Java Sound Issues

16Applets and Java Web Start Applications

16.1Configuration Problems

16.1.2Common Configuration Problems
16.1.3Manage Java Runtime
16.1.4Pass Parameters to the JRE
16.1.5Java Deployment Home
16.1.6Deployment Tracing
16.1.7Deployment Cache
16.1.8Network Configuration16.2Troubleshoot Applets

16.2.1Plugin Cheat Sheet for Applet Start
16.2.2Browser or Java Process Crash
16.2.3Unresponsive Web page16.3Avoid Security Dialogs

16.3.1Signed Applications
16.3.2Mixed Code Issues16.4Development Tips

Part V Submit Bug Reports 17Submit a Bug Report

17.1Check for Fixes in Update Releases
17.2Prepare to Submit a Bug Report
17.3Collect Data for a Bug Report

17.3.1Hardware Details
17.3.2Operating System Details
17.3.3Java SE Version
17.3.4Command-Line Options
17.3.5Environment Variables
17.3.6Fatal Error Log
17.3.7Core or Crash Dump
17.3.8Detailed Description of the Problem
17.3.9Logs and Traces
17.3.10Results from Troubleshooting Steps17.4Collect Core Dumps

17.4.1Collect Core Dumps on Oracle Solaris
17.4.2Collect Core Dumps on Linux
17.4.3Reasons for Not Getting a Core File
17.4.4Collect Crash Dumps on Windows

Part VI Appendix AFatal Error Log

Location of Fatal Error Log
Description of Fatal Error Log
Header Format
Thread Section Format
Process Section Format
System Section Format

BJava 2D Properties

Properties on Oracle Solaris and Linux
Properties on Windows

CEnvironment Variables and System Properties

TheJAVA_HOMEEnvironment Variable
TheJAVA_TOOL_OPTIONSEnvironment Variable Property

DCommand-Line Options

Java HotSpot VM Command-Line Options
Other Command-Line Options

ESummary of Tools in This Release