IBM SDK For Java: Diagnostics Guide Java Jdk1.5

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 498

DownloadIBM SDK For Java: Diagnostics Guide Java Jdk1.5
Open PDF In BrowserView PDF
IBM Developer Kit and Runtime Environment, Java
Technology Edition, Version 5.0
Version 5 Release 0

Diagnostics Guide



IBM Developer Kit and Runtime Environment, Java
Technology Edition, Version 5.0
Version 5 Release 0

Diagnostics Guide



Note
Before using this information and the product it supports, read the information in “Notices” on page 463.

Twelfth Edition (November 2009)
This edition applies to all the platforms that are included in the IBM Developer Kit and Runtime Environment, Java
2 Technology Edition, Version 5.0 and to all subsequent releases and modifications until otherwise indicated in new
editions. Technical changes made for all the editions of this book are indicated by vertical bars to the left of the
changes.
© Copyright IBM Corporation 2003, 2010.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.

Contents
Figures . . . . . . . . . . . . . . . ix
Tables . . . . . . . . . . . . . . . xi
About the Diagnostics Guide . . . . . xiii
What does the "Java Virtual Machine (JVM)"
Who should read this book . . . . . .
Using this book. . . . . . . . . .
Other sources of information . . . . .
Reporting problems . . . . . . . .
Conventions and terminology . . . . .
How to send your comments . . . . .
Contributors . . . . . . . . . . .
Summary of changes . . . . . . . .

mean? xiii
. . . xiv
. . . xiv
. . . xv
. . . xv
. . . xv
. . . xvi
. . . xvi
. . . xvi

Tilt ratio . . . . . . . . . . . .
How to do heap sizing . . . . . . . .
Initial and maximum heap sizes . . . .
Using verbose:gc . . . . . . . . .
Using fine tuning options. . . . . . .
Interaction of the Garbage Collector with
applications . . . . . . . . . . . .
How to coexist with the Garbage Collector . .
Root set . . . . . . . . . . . .
Thread local heap . . . . . . . . .
Bug reports . . . . . . . . . . .
Finalizers . . . . . . . . . . . .
Manually starting the Garbage Collector. .
Frequently asked questions about the Garbage
Collector . . . . . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

20
21
21
21
22

.
.
.
.
.
.
.

.
.
.
.
.
.
.

22
23
23
23
23
24
25

.

. 26

Part 1. Understanding the IBM
Software Developers Kit (SDK) for
Java . . . . . . . . . . . . . . . . 1

Chapter 3. Class loading . . . . . . . 29

Chapter 1. The building blocks of the
IBM Virtual Machine for Java. . . . . . 3

Chapter 4. Class data sharing . . . . . 33

Java application stack . . . . . . . . .
Components of the IBM Virtual Machine for Java
JVM Application Programming Interface (API)
Diagnostics component . . . . . . . .
Memory management . . . . . . . .
Class loader . . . . . . . . . . .
Interpreter . . . . . . . . . . . .
Platform port layer . . . . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

4
4
5
5
5
6
6
6

Chapter 2. Memory management . . . . 7
Overview of memory management . . . . . . . 7
Object allocation . . . . . . . . . . . . 7
Reachable objects . . . . . . . . . . . . 8
Garbage collection . . . . . . . . . . . 8
Heap sizing problems . . . . . . . . . . 8
Allocation . . . . . . . . . . . . . . . 9
Heap lock allocation . . . . . . . . . . . 9
Cache allocation . . . . . . . . . . . . 9
Large Object Area . . . . . . . . . . . 10
Detailed description of garbage collection . . . . 11
Mark phase . . . . . . . . . . . . . 11
Sweep phase . . . . . . . . . . . . . 14
Compaction phase . . . . . . . . . . . 15
Subpool (AIX, Linux PPC and zSeries, z/OS and
i5/OS only) . . . . . . . . . . . . . 16
Reference objects . . . . . . . . . . . 16
Final reference processing . . . . . . . . 17
JNI weak reference . . . . . . . . . . . 17
Heap expansion . . . . . . . . . . . . 17
Heap shrinkage . . . . . . . . . . . . 18
Generational Concurrent Garbage Collector. . . . 19
Tenure age. . . . . . . . . . . . . . 20
© Copyright IBM Corp. 2003, 2010

The parent-delegation model . . .
Namespaces and the runtime package
Custom class loaders . . . . . .

.
.
.

.
.
.

.
.
.

.
.
.

. 29
. 30
. 31

Chapter 5. The JIT compiler. . . . . . 35
JIT compiler overview . . . . . . . . . .
How the JIT compiler optimizes code. . . . .
Phase 1 - inlining . . . . . . . . . .
Phase 2 - local optimizations . . . . . .
Phase 3 - control flow optimizations . . . .
Phase 4 - global optimizations . . . . . .
Phase 5 - native code generation . . . . .
Frequently asked questions about the JIT compliler

.
.
.
.
.
.
.

35
36
36
36
37
37
37
37

Chapter 6. Java Remote Method
Invocation . . . . . . . . . . . . . 39
The RMI implementation . . . . . . .
Thread pooling for RMI connection handlers
Understanding distributed garbage collection
Debugging applications involving RMI . .

.
.
.
.

.
.
.
.

.
.
.
.

39
40
40
41

Chapter 7. The ORB . . . . . . . . . 43
CORBA. . . . . . . . . . . . . .
RMI and RMI-IIOP . . . . . . . . . .
Java IDL or RMI-IIOP? . . . . . . . .
RMI-IIOP limitations . . . . . . . . .
Further reading . . . . . . . . . . .
Examples of client–server applications . . .
Interfaces . . . . . . . . . . . .
Remote object implementation (or servant) .
Stubs and ties generation . . . . . . .
Server code . . . . . . . . . . .
Summary of major differences between RMI
(JRMP) and RMI-IIOP . . . . . . . .
Using the ORB . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

43
44
44
44
45
45
45
45
46
47

.
.

. 50
. 51

iii

How the ORB works . . . .
The client side . . . . .
The server side . . . . .
Additional features of the ORB .
Portable object adapter . .
Fragmentation . . . . .
Portable interceptors . . .
Interoperable Naming Service

. .
. .
. .
. .
. .
. .
. .
(INS)

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

54
54
59
61
61
63
63
66

Chapter 8. The Java Native Interface
(JNI) . . . . . . . . . . . . . . . . 69
Overview of JNI . . . . . . . . . . . . .
The JNI and the Garbage Collector . . . . . .
Overview of JNI object references . . . . . .
JNI transitions . . . . . . . . . . . .
Copying and pinning . . . . . . . . . . .
Using the isCopy flag . . . . . . . . . .
Using the mode flag . . . . . . . . . .
A generic way to use the isCopy and mode flags
Handling exceptions . . . . . . . . . . .
Synchronization . . . . . . . . . . . . .
Debugging the JNI . . . . . . . . . . . .
JNI checklist . . . . . . . . . . . . . .

Part 2. Submitting problem reports

69
70
70
73
75
75
76
76
76
77
78
79

81

Part 3. Problem determination . . . 83
Chapter 9. First steps in problem
determination . . . . . . . . . . . . 85
Chapter 10. AIX problem determination 87
Setting up and checking your AIX environment
Enabling full AIX core files . . . . . .
General debugging techniques . . . . . .
AIX debugging commands . . . . . .
DBX Plug-in . . . . . . . . . . .
Diagnosing crashes . . . . . . . . .
Documents to gather . . . . . . . .
Locating the point of failure . . . . .
Debugging hangs . . . . . . . . . .
AIX deadlocks . . . . . . . . . .
AIX busy hangs . . . . . . . . .
Poor performance on AIX . . . . . .
Understanding memory usage. . . . . .
32- and 64-bit JVMs . . . . . . . .
The 32-bit AIX Virtual Memory Model . .
The 64-bit AIX Virtual Memory Model . .
Changing the Memory Model (32-bit JVM)
The native and Java heaps . . . . . .
The AIX 32-bit JVM default memory models
Monitoring the native heap. . . . . .
Native heap usage. . . . . . . . .
Specifying MALLOCTYPE . . . . . .
Monitoring the Java heap . . . . . .
Receiving OutOfMemoryError exceptions .
Is the Java or native heap exhausted? . .
Java heap exhaustion . . . . . . . .
Native heap exhaustion . . . . . . .

iv

IBM SDK for Java: Diagnostics Guide

.
.
.
.
.

. 87
. 88
. 89
. 90
. 99
. . 100
. . 100
. . 101
. . 102
. . 102
. . 102
. . 105
. . 105
. . 105
. . 105
. . 106
. . 107
. . 107
108
. . 108
. . 109
. . 110
. . 110
. . 110
. . 111
. . 111
. . 111

AIX fragmentation problems . .
Submitting a bug report . . . .
Debugging performance problems .
Finding the bottleneck . . . .
CPU bottlenecks . . . . . .
Memory bottlenecks . . . . .
I/O bottlenecks. . . . . . .
JVM heap sizing . . . . . .
JIT compilation and performance .
Application profiling . . . . .
MustGather information for AIX . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

112
113
113
113
114
118
118
118
119
119
119

Chapter 11. Linux problem
determination . . . . . . . . . . . 121
Setting up and checking your Linux environment
General debugging techniques. . . . . . .
Using system dump tools . . . . . . .
Examining process information . . . . .
ldd . . . . . . . . . . . . . . .
Tracing tools . . . . . . . . . . .
Debugging with gdb . . . . . . . . .
Diagnosing crashes . . . . . . . . . .
Debugging hangs . . . . . . . . . . .
Debugging memory leaks . . . . . . . .
Debugging performance problems . . . . .
Finding the bottleneck . . . . . . . .
CPU usage . . . . . . . . . . . .
Memory usage . . . . . . . . . . .
Network problems . . . . . . . . .
JVM heap sizing . . . . . . . . . .
JIT compilation and performance . . . . .
Application profiling . . . . . . . . .
MustGather information for Linux . . . . .
Known limitations on Linux . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

121
123
123
124
126
126
127
129
130
131
131
131
131
132
132
133
133
133
134
136

Chapter 12. Windows problem
determination . . . . . . . . . . . 139
Setting up and checking your Windows
environment. . . . . . . . . . . . .
Windows 32-bit large address aware support
General debugging techniques. . . . . . .
System dump . . . . . . . . . . .
Diagnosing crashes in Windows . . . . . .
Data to send to IBM . . . . . . . . .
Debugging hangs . . . . . . . . . . .
Getting a dump from a hung JVM . . . .
Analyzing deadlocks . . . . . . . . .
Debugging memory leaks . . . . . . . .
The Windows memory model . . . . . .
Classifying leaks . . . . . . . . . .
Tracing leaks . . . . . . . . . . .
Using Heapdump to debug memory leaks. .
OutOfMemoryError creating a thread . . . .
Debugging performance problems . . . . .
Finding the bottleneck . . . . . . . .
Windows systems resource usage. . . . .
JVM heap sizing . . . . . . . . . .
JIT compilation and performance . . . . .
Application profiling . . . . . . . . .
MustGather information for Windows . . . .

. 139
140
. 141
. 141
. 142
. 142
. 143
. 143
. 143
. 143
. 143
. 144
. 144
. 145
. 145
. 145
. 145
. 146
. 146
. 146
. 146
. 146

Chapter 13. z/OS problem
determination . . . . . . . . . . . 149
Setting up and checking your z/OS environment
Maintenance. . . . . . . . . . . .
LE settings . . . . . . . . . . . .
Environment variables . . . . . . . .
Private storage usage . . . . . . . . .
Setting up dumps . . . . . . . . . .
General debugging techniques. . . . . . .
Using IPCS commands . . . . . . . .
Using dbx . . . . . . . . . . . .
Interpreting error message IDs . . . . .
Diagnosing crashes . . . . . . . . . .
Documents to gather . . . . . . . . .
Determining the failing function . . . . .
Working with TDUMPs using IPCS . . . .
Debugging hangs . . . . . . . . . . .
The process is deadlocked . . . . . . .
The process is looping . . . . . . . .
The process is performing badly . . . . .
Understanding Memory Usage . . . . . .
Allocations to LE HEAP . . . . . . . .
z/OS virtual storage . . . . . . . . .
OutOfMemoryError exceptions . . . . .
Debugging performance problems . . . . .
Finding the bottleneck . . . . . . . .
z/OS systems resource usage . . . . . .
JVM heap sizing . . . . . . . . . .
JIT compilation and performance . . . . .
Application profiling . . . . . . . . .
MustGather information for z/OS . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

149
149
149
149
149
150
151
152
152
152
153
153
154
156
159
160
160
161
161
161
161
162
163
163
164
164
164
164
164

Chapter 14. IBM i problem
determination . . . . . . . . . . . 167
Determining which VM is in use . . . . . .
Setting up your IBM Technology for Java
Environment . . . . . . . . . . . .
Required Software and Licensing . . . . .
Configuring JAVA_HOME . . . . . . .
Enabling i5/OS PASE core files . . . . .
Setting environment variables for i5/OS PASE
or QShell . . . . . . . . . . . . .
Determining the home directory for a user .
Setting default Java command-line options .
General debugging techniques. . . . . . .
Diagnosing problems at the command line . .
IBM i debugging commands . . . . . . .
Work with Active Jobs (WRKACTJOB) . . .
Work with Job (WRKJOB) . . . . . . .
Work with System Status (WRKSYSSTS) . .
Work with Disk Status (WRKDSKSTS) . . .
Process Status (ps). . . . . . . . . .
Debugger (dbx). . . . . . . . . . .
Debugging performance problems . . . . .
Analyzing CPU bottlenecks. . . . . . .
Analyzing memory problems . . . . . .
Analyzing I/O problems . . . . . . .
Diagnosing crashes . . . . . . . . . .
Checking the system environment . . . .
Finding out about the Java environment . .

. 167
.
.
.
.

167
168
168
169

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

170
171
172
173
173
174
174
174
174
174
175
175
175
176
178
179
182
182
182

Detailed crash diagnosis . . . . . . . .
Diagnosing hangs . . . . . . . . . . .
i5/OS deadlocks . . . . . . . . . .
i5/OS busy hangs . . . . . . . . . .
Understanding memory usage. . . . . . .
The 32-bit i5/OS PASE Virtual memory model
The process and garbage-collected heaps . .
Monitoring the garbage-collected heap . . .
Process heap usage . . . . . . . . .
OutOfMemoryError exceptions . . . . .
Garbage-collected heap exhaustion . . . .
Submitting a bug report . . . . . . . .
Using dbx . . . . . . . . . . . . .
Using the DBX Plug-in for Java . . . . .
Important dbx usage notes and warnings . .
Using dbx to investigate a Java system dump
Starting dbx on a system dump
(core.{date}.{time}.{pid}.dmp) . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.

182
182
183
183
183
183
184
184
184
185
185
185
186
186
187
188

. 188

Chapter 15. Sun Solaris problem
determination . . . . . . . . . . . 189
Chapter 16. Hewlett-Packard SDK
problem determination . . . . . . . 191
Chapter 17. ORB problem
determination . . . . . . . . . . . 193
Identifying an ORB problem . . . . . . .
Debug properties . . . . . . . . . . .
ORB exceptions . . . . . . . . . . .
Completion status and minor codes . . . . .
Java security permissions for the ORB . . . .
Interpreting the stack trace . . . . . . . .
Description string . . . . . . . . . .
Interpreting ORB traces . . . . . . . . .
Message trace . . . . . . . . . . .
Comm traces . . . . . . . . . . .
Client or server. . . . . . . . . . .
Service contexts . . . . . . . . . .
Common problems . . . . . . . . . .
ORB application hangs . . . . . . . .
Running the client without the server running
before the client is started . . . . . . .
Client and server are running, but not naming
service. . . . . . . . . . . . . .
Running the client with MACHINE2 (client)
unplugged from the network . . . . . .
IBM ORB service: collecting data . . . . . .
Preliminary tests . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.

193
194
195
196
197
198
199
199
199
200
201
202
202
202

. 203
. 204
. 204
. 205
. 205

Chapter 18. NLS problem
determination . . . . . . . . . . . 207
Overview of fonts . . . . . . . . . .
Font utilities. . . . . . . . . . . .
Common NLS problem and possible causes .

.
.
.

. 207
. 208
. 209

| Chapter 19. Attach API problem
| determination . . . . . . . . . . . 211

Contents

v

Part 4. Using diagnostic tools . . . 215
Chapter 20. Overview of the available
diagnostics . . . . . . . . . . . . 217
Categorizing the problem . . .
Summary of diagnostic information
Summary of cross-platform tooling
Heapdump analysis tooling .
Cross-platform dump viewer .
JVMTI tools . . . . . . .
JVMPI tools . . . . . . .
JPDA tools . . . . . . .
DTFJ . . . . . . . . .
Trace formatting . . . . .
JVMRI. . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

217
217
219
219
219
219
220
220
220
220
221

Chapter 21. Using dump agents . . . 223
Using the -Xdump option . . . . . .
Merging -Xdump agents. . . . . .
Dump agents . . . . . . . . . .
Console dumps. . . . . . . . .
System dumps . . . . . . . . .
Stack dumps . . . . . . . . .
LE CEEDUMPs. . . . . . . . .
Tool option . . . . . . . . . .
Javadumps . . . . . . . . . .
Heapdumps . . . . . . . . . .
Snap traces . . . . . . . . . .
Dump events . . . . . . . . . .
Advanced control of dump agents . . .
exec option . . . . . . . . . .
file option . . . . . . . . . .
filter option . . . . . . . . . .
opts option . . . . . . . . . .
Priority option . . . . . . . . .
range option. . . . . . . . . .
request option . . . . . . . . .
defaults option . . . . . . . . .
Dump agent tokens . . . . . . . .
Default dump agents . . . . . . . .
Removing dump agents . . . . . . .
Dump agent environment variables . . .
Signal mappings . . . . . . . . .
Windows, Linux, AIX, and i5/OS specifics
z/OS specifics . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

223
225
227
228
228
229
229
230
231
231
232
232
233
233
234
234
235
236
236
237
237
238
238
239
239
241
241
242

Chapter 22. Using Javadump. . . . . 245
Enabling a Javadump. . . . . . . .
Triggering a Javadump . . . . . . .
Interpreting a Javadump . . . . . .
Javadump tags . . . . . . . . .
TITLE, GPINFO, and ENVINFO sections
Storage Management (MEMINFO) . .
Locks, monitors, and deadlocks (LOCKS)
Threads and stack trace (THREADS) .
Classloaders and Classes (CLASSES) .
Environment variables and Javadump . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

245
245
247
247
248
250
252
253
255
256

Chapter 23. Using Heapdump . . . . 257
vi

IBM SDK for Java: Diagnostics Guide

Information for users of previous releases of
Heapdump . . . . . . . . . . . . .
Getting Heapdumps . . . . . . . . . .
Enabling text formatted ("classic") Heapdumps
Available tools for processing Heapdumps . .
Using -Xverbose:gc to obtain heap information .
Environment variables and Heapdump . . . .
Text (classic) Heapdump file format . . . . .

. 257
. 257
258
. 258
. 258
. 258
. 259

Chapter 24. Using system dumps and
the dump viewer . . . . . . . . . . 263
Overview of system dumps . . .
System dump defaults . . . . .
Overview of the dump viewer. . .
Using the dump extractor, jextract
Using the dump viewer, jdmpview
Dump viewer commands . . . .
General commands . . . . .
Working with locks . . . . .
Showing details of a dump . . .
Analyzing the memory . . . .
Working with classes . . . . .
Working with objects . . . . .
Generating Heapdumps . . . .
Working with trace . . . . .
Example session . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

263
264
264
264
266
267
267
269
269
269
270
271
271
272
273

Chapter 25. Tracing Java applications
and the JVM . . . . . . . . . . . . 283
What can be traced? . . . . . . . . .
Types of tracepoint . . . . . . . . .
Default tracing . . . . . . . . . . .
Where does the data go? . . . . . . .
Writing trace data to memory buffers . .
Writing trace data to a file . . . . . .
External tracing . . . . . . . . .
Tracing to stderr . . . . . . . . .
Trace combinations . . . . . . . .
Controlling the trace . . . . . . . . .
Specifying trace options . . . . . . .
Detailed descriptions of trace options . .
Using the Java API . . . . . . . .
Using the trace formatter . . . . . . .
Determining the tracepoint ID of a tracepoint
Application trace . . . . . . . . . .
Implementing application trace . . . .
Using application trace at run time . . .
Using method trace . . . . . . . . .
Running with method trace . . . . .
Untraceable methods . . . . . . . .
Examples of use . . . . . . . . .
Example of method trace output . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

283
284
284
285
286
286
287
287
287
287
288
288
303
304
305
306
306
308
309
309
311
313
314

Chapter 26. JIT problem determination 317
Diagnosing a JIT problem . . . . . .
Disabling the JIT compiler . . . . .
Selectively disabling the JIT compiler .
Locating the failing method . . . .
Identifying JIT compilation failures . .
Performance of short-running applications

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

317
317
318
319
320
321

JVM behavior during idle periods

.

.

.

.

.

. 321

Chapter 27. The Diagnostics Collector 323
Introduction to the Diagnostics Collector . . . .
Using the Diagnostics Collector . . . . . . .
Collecting diagnostics from Java runtime problems
Verifying your Java diagnostics configuration. . .
Configuring the Diagnostics Collector . . . . .
Diagnostics Collector settings . . . . . . .
Known limitations. . . . . . . . . . . .

323
323
323
325
325
325
327

Chapter 28. Garbage Collector
diagnostics . . . . . . . . . . . . 329
How do the garbage collectors work? . . .
Common causes of perceived leaks . . . .
Listeners . . . . . . . . . . . .
Hash tables . . . . . . . . . . .
Static class data . . . . . . . . .
JNI references . . . . . . . . . .
Objects with finalizers . . . . . . .
-verbose:gc logging . . . . . . . . .
Global collections . . . . . . . . .
Garbage collection triggered by System.gc()
Allocation failures . . . . . . . . .
Scavenger collections . . . . . . . .
Concurrent garbage collection . . . . .
Timing problems during garbage collection
-Xtgc tracing . . . . . . . . . . .
-Xtgc:backtrace . . . . . . . . . .
-Xtgc:compaction . . . . . . . . .
-Xtgc:concurrent . . . . . . . . .
-Xtgc:dump . . . . . . . . . . .
-Xtgc:excessiveGC . . . . . . . . .
-Xtgc:freelist . . . . . . . . . . .
-Xtgc:parallel . . . . . . . . . .
-Xtgc:references. . . . . . . . . .
-Xtgc:scavenger. . . . . . . . . .
-Xtgc:terse . . . . . . . . . . .
Finding which methods allocated large objects

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.

. 347
. 347
. 348

Chapter 29. Class-loader diagnostics
Class-loader command-line options .
Class-loader runtime diagnostics . .
Loading from native code . . . .

.
.
.

.
.
.

.
.
.

329
329
329
330
330
330
330
330
331
332
333
334
335
339
340
340
341
341
341
342
342
343
343
343
344
344

347

Chapter 30. Shared classes
diagnostics . . . . . . . . . . . . 351
Deploying shared classes . . . . . . .
Cache naming . . . . . . . . . .
Cache access . . . . . . . . . .
Cache housekeeping . . . . . . . .
Cache performance . . . . . . . .
Compatibility between service releases . .
Nonpersistent shared cache cleanup . . .
Dealing with runtime bytecode modification .
Potential problems with runtime bytecode
modification . . . . . . . . . . .
Modification contexts. . . . . . . .
SharedClassHelper partitions . . . . .
Using the safemode option . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

351
351
352
352
353
354
355
356

.
.
.
.

.
.
.
.

356
357
357
357

Further considerations for runtime bytecode
modification . . . . . . . . . . . . .
Understanding dynamic updates . . . . . . .
Using the Java Helper API . . . . . . . . .
SharedClassHelper API . . . . . . . . .
Understanding shared classes diagnostics output
Verbose output . . . . . . . . . . . .
VerboseIO output . . . . . . . . . . .
VerboseHelper output . . . . . . . . .
printStats utility . . . . . . . . . . .
printAllStats utility . . . . . . . . . .
Debugging problems with shared classes . . . .
Using shared classes trace . . . . . . . .
Why classes in the cache might not be found or
stored . . . . . . . . . . . . . . .
Dealing with initialization problems . . . . .
Dealing with verification problems . . . . .
Dealing with cache problems . . . . . . .
Class sharing with OSGi ClassLoading framework

358
358
361
362
363
363
363
364
364
365
366
366
366
367
369
369
370

Chapter 31. Using the Reliability,
Availability, and Serviceability
Interface . . . . . . . . . . . . . 371
Preparing to use JVMRI . .
Writing an agent . . .
Registering a trace listener
Changing trace options .
Starting the agent . . .
Building the agent. . .
Agent design . . . .
JVMRI functions . . . .
API calls provided by JVMRI
CreateThread . . . .
DumpDeregister . . .
DumpRegister . . . .
DynamicVerbosegc . .
GenerateHeapdump . .
GenerateJavacore . . .
GetComponentDataArea.
GetRasInfo . . . . .
InitiateSystemDump . .
InjectOutOfMemory . .
InjectSigSegv . . . .
NotifySignal . . . . .
ReleaseRasInfo . . . .
RunDumpRoutine . . .
SetOutOfMemoryHook .
TraceDeregister . . . .
TraceDeregister50 . . .
TraceRegister . . . .
TraceRegister50 . . . .
TraceResume . . . .
TraceResumeThis . . .
TraceSet . . . . . .
TraceSnap . . . . .
TraceSuspend . . . .
TraceSuspendThis . . .
RasInfo structure . . . .
RasInfo request types. . .
Intercepting trace data . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Contents

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

371
371
372
373
373
373
374
374
375
375
375
375
376
376
376
376
377
377
377
377
378
378
378
379
379
379
379
380
380
380
381
381
381
381
382
382
382

vii

The -Xtrace:external=