Addresses, finding, 92
Age tables, 19
Allocating humongous objects, allocation path, 19, 21
Available regions, 8
Boolean command-line options, 145
Cards, definition, 25
Chunks. See also Regions
cards, 25
Class instances, displaying, 88
Classes
unloading, 153
Cleanup phase, G1 GC, 13
Cleanup stage of concurrent marking, 36
CLHSDB (Command-Line HotSpot Debugger). See also HSDB (HotSpot Debugger)
command list, 102
Java objects, examining, 101
launching, 100
VM data structures, examining, 101
CMS (Concurrent Mark Sweep) GC, pause times, 5–7
Coarse-grained bitmap, 25
Collection sets (CSets). See CSets (collection sets)
Command-line options. See also specific options
boolean, 145
default values, 146
diagnostic options, enabling, 153–154
overtuning, causing evacuation failure, 59
types of, 145
Compaction
CMS (Concurrent Mark Sweep) GC, 7
Compute Reverse Pointers, 89–90
Concurrent cycle, G1 GC, 13
Concurrent garbage collection, definition, 2
Concurrent Mark Sweep (CMS) GC, pause times, 5–7
Concurrent marking
concurrent marking pre-write barriers, 35
description, 13
high remark times, 36
identifying allocated objects, 30
overview, 33
pre-write barriers, 35
PTAMS (previous TAMS), 30–33, 37
SATB (snapshot-at-the-beginning), 30
SATB pre-write barriers, 35
TAMS (top-at-mark-starts), 30–33
Concurrent marking, stages of
cleanup, 36
initial mark, 34
remark, 36
root region scanning, 34
Concurrent marking cycle, triggering, 21
Concurrent marking phase, tuning, 52–54
Concurrent marking pre-write barriers, 35
Concurrent marking stage of concurrent marking, 34–36
Concurrent refinement threads, 42–43
logging, 148
maximum number, setting, 29
purpose of, 29
Concurrent root region scanning, 13
Constant pools, 70
Core files. See also Crash dump files
attaching to HSDB, 76
collecting, 108
command-line JVM options, displaying, 98, 100
creating, 108
description, 108
exploring with the SA Plugin, 118–119
Java threads, displaying, 119–120
JFR information, extracting, 107–108
JVM version, displaying, 98–99
multiple debugging sessions on, 113
opening with Serviceability Agent, 76–77
permanent generation statistics, printing, 103–104
process map, printing, 104
reading bits with the /proc
interface, 111
thread stack trace, displaying, 119–120
Core files, transported
shared library problems, 109–110, 112
Crash dump files. See also Core files
attaching HSDB to, 76
collecting, 108
creating, 108
description, 108
reading bits with the Windows Debugger Engine, 111
definition, 9
minimum old CSet size, setting, 57–58
old regions per CSet, maximum threshold, 58
old regions per CSet, minimum threshold, 57–58
Deadlocks
Debug messages, enable printing on Windows, 112
Debugging tools. See JDI (Java Debug Interface); Serviceability Agent
Deduplicating Java strings, 149–151
Efficiency, garbage collection. See GC efficiency
Ergonomics heuristics, dumping, 55
Evacuation, 47
definition, 16
duration of, determining, 37
to-space exhausted
log message, 53–54
Evacuation failures, potential causes
heap size, 59
insufficient space in survivor regions, 60
long-lived humongous objects, 59–60
overtuning JVM command-line options, 59
External root region scanning, 42
Finalizable objects, printing details of, 103
FinalizerInfo, 103
Find Value in Code Cache, 92–93
Find Value in CodeCache (in VisualVM), 122–123
Fine RSets, 25
Fragmentation
CMS (Concurrent Mark Sweep) GC, 7
G1 GC, 10
per region, controlling, 58
Full GCs
G1 garbage collector. See G1 GC
G1 GC. See also Regions
available regions, 8
cleanup, 13
concurrent cycle, 13
concurrent marking, 13
concurrent root region scanning, 13
enabling, 146
fragmentation, 10
free memory amount, setting, 146–147
heap sizing, 14
initial-mark phase, 13
marking the live object graph, 13
pause times, 10
remarking, 13
threads, setting number of, 146
Garbage, maximum allowable, 56–59
Garbage collectors. common issues, 7–8
Garbage First garbage collector. See G1 GC
Garbage-collector-related issues, 92
definition, 17
identifying garbage collection candidates, 22–24
GC Worker Other
times too high, 48
GCLABs (GC local allocation buffers), 47
gcore
tool, 108
Generations, definition, 24
Heap
, occupancy threshold, adaptive adjustment, 151
Heap Parameters, 98
HeapDumper, 103
boundaries, displaying, 98–99, 101
dividing into regions. See Regions
dumping, 103
free memory, setting, 152
G1 concurrent cycle, initiating, 149
liveness information, printing, 147
raw memory contents, displaying, 94
region size, setting, 146
size, causing evacuation failure, 59
size changes, logging, 152
sizing, G1 GC, 14
HotSpot Serviceability Agent. See Serviceability Agent
Hprof files, creating, 149
HSDB (HotSpot Debugger). See also CLHSDB (Command-Line HotSpot Debugger)
connecting to debug server, 78–80
core files, attaching to, 76
debugging modes, 74
HotSpot processes, attaching to, 74–76
launching, 72
HSDB (HotSpot Debugger) tools and utilities
addresses, finding, 92
class instances, displaying, 88
Compute Reverse Pointers, 89–90
displaying Java threads, 80–84
Find Pointer, 92
Find Value in Code Cache, 92–93
garbage-collector-related issues, 92
heap boundaries, displaying, 98–99
Heap Parameters, 98
JIT compiler-related problems, 92–93, 95–97
liveness path, getting, 88–89, 91
Memory Viewer, 94
method bytecodes, displaying, 95–97, 120–122
Monitor Cache Dump, 94
raw memory contents, displaying, 94
reference paths, computing, 89–90
synchronization-related issues, 95
Humongous continue regions, 12
causing evacuation failure, 59–60
description, 12
identifying, 19
optimizing allocation and reclamation of, 20
short-lived, optimizing collection of, 21
Humongous Reclaim
, 50
Humongous regions
contiguity, 21
definition, 11
Humongous start regions, 12
IHOP. See –XX:InitiatingHeapOccupancyPercent
Initial-mark stage of concurrent marking, 34
Initial-mark phase, G1 GC, 13
inspect
command, 101
Java application threads. See Threads
Java Debug Interface (JDI). See JDI (Java Debug Interface)
Java heaps. See Heaps
Java objects. See also Humongous objects; Young collection pauses, live objects
examining, 101
ordinary object pointers, inspecting, 120–121
Java Stack Trace panel, 119–120
Java strings
deduplication statistics, printing, 151
deduplication threshold, setting, 150
Java threads. See Threads
java.lang.OutOfMemoryError
, 123–130
java.lang.OutOfMemoryError
, troubleshooting, 123–130
Java-level deadlocks, troubleshooting, 131–136
JavaScript Debugger (JSDB), 108
JavaScript interface to Serviceability Agent, 108
description, 113
SA Core Attaching Connector, 113
SA Debug Server Attaching Connector, 114
SAPID Attaching Connector, 113
JFR information, extracting, 107–108
JIT compiler-related problems, 92–93, 95–97
jsadebugd
utility, 114
JSDB (JavaScript Debugger), 108
JVM version, displaying, 98–99
Large object allocations. See Humongous objects
LIBSAPROC_DEBUG
environment variable, 112
libsaproc.so binaries, 69
Licensed features, enabling, 154
Live object graph, marking, 13
Live objects, liveness factor per region, calculating, 22–24
Liveness information, printing, 147
Liveness path, getting, 88–89, 91
Log messages, evacuation failures, 53–54
Logging
concurrent refinement threads, 148
heap size changes, 152
Marking the live object graph, 13
Marking threshold, setting, 54
Memory
free amount, setting, 146–147, 152
reserving for promotions, 147
Memory Viewer, 94
Method bytecodes, displaying, 95–97, 120–122
Mixed collection cycle
definition, 23
number of mixed collections, determining, 23–24
Mixed collection phase
ergonomics heuristics, dumping, 55
fragmentation, maximum allowable, 56–59
fragmentation per region, controlling, 58
garbage, maximum allowable, 56–59
minimum old CSet size, setting, 57–58
old regions per CSet, maximum threshold, 58
old regions per CSet, minimum threshold, 57–58
reclaimable percentage threshold, 56–59
Monitor Cache Dump, 94
Multithreaded parallel garbage collection, 1–2
Multithreaded reference processing, enabling, 62
Mutator threads, definition, 29
Native methods versus nmethods, 44
Nmethods, 44
Object histograms, collecting, 87–89, 105
Old generation, live objects
age tables, 19
aging, 19
Old-to-old references, 25
Old-to-young references, 25
oops (ordinary object pointers), inspecting, 120–121
interrupting Java application threads, 4
pause times, 4
Pauses
Concurrent Mark Sweep (CMS) GC, 5–7
G1 GC, 10
Parallel GC, 4
Serial GC, 4
time goal, setting, 151
.pdb
files, setting the path to, 111
Performance tuning. See Tuning
Permanent generation statistics, printing, 103–104
Per-region-tables (PRTs), 25–26
PMap, 104
Postmortem analysis
Java HotSpot VM crashes, 136–143
Previous TAMS (PTAMS), 30–33, 37
Pre-write barriers
concurrent marking, 35
in RSets, 35
Process maps, printing, 104
Processes
debugging, 113
exploring with the SA Plugin, 118–119
Java threads, displaying, 119–120
JFR information, extracting, 107–108
JVM version, displaying, 98–99
permanent generation statistics, printing, 103–104
process map, printing, 104
reading bits with the /proc
interface, 111
reading bits with the Windows Debugger Engine, 111
remote debugging, 114
thread stack trace, displaying, 119–120
Promotion failure. See Evacuation failures
PRTs (per-region-tables), 25–26
PTAMS (previous TAMS), 30–33, 37
Raw memory contents, displaying, 94
Reading bits with the /proc
interface, 111
Reclaimable percentage threshold, mixed collection phase, 56–59
Reclaiming regions, 13
Reclamation, 47
Reference object types, 60
Reference paths, computing, 89–90
Reference processing
enabling multithreaded reference processing, 62
excessive weak references, correcting, 63
observing, 60
overhead, 36
overview, 60
reference object types, 60
adaptive selection, overwriting, 18
average, 10
calculating, 10
determining, 18
setting, 146
Regions. See also Chunks; CSets (collection sets); RSets (remembered sets)
available, 8
candidates, identifying. See GC efficiency
concurrent root region scanning, 13
GC efficiency, 17
humongous, 11
mixed GC, 8
mixing old generation with young collections, 8
reclaiming, 13
region size, 10
root, definition, 34
sorting. See GC efficiency
survivor fill capacity, 19
types of, 11
Remark stage of concurrent marking, 36
Remark times, high, reasons for, 36
Remarking phase, G1 GC, 13
Remembered sets (RSets). See RSets (remembered sets)
Resizing, young generation, 18
RMI (Remote Method Invocation), 114
Root objects, definition, 34
Root references, collecting, 13
Root region scanning stage of concurrent marking, 34
coarse, 25
coarse-grained bitmap, 25
concurrent marking pre-write barriers, 35
concurrent refinement threads, 28–30
density, 25
fine, 25
number per region, 25
pre-write barriers, 35
printing a summary of, 147–148
SATB pre-write barriers, 35
size, 11
sparse, 25
visualizing potential improvements, 47
RSets (remembered sets), importance of
old-to-old references, 25
old-to-young references, 25
PRTs (per-region-tables), 25–26
SA_ALTROOT
environment variable
description, 112
setting, 110
SA_IGNORE_THREADDB
environment variable, 112
SATB (snapshot-at-the-beginning), 30
SATB pre-write barriers, 35
sawindbg.dll binaries, 69
Scanning nmethods, 44
Serial GC. See also Parallel GC
definition, 4
interrupting Java application threads, 5
pause times, 4
components, 69
description, 68
enable printing of debug messages on Windows, 112
environment variables, 112
HotSpot data structures, 70–71
purpose of, 68
version matching, 71
Serviceability Agent, debugging tools. See also CLHSDB (Command-Line HotSpot Debugger); HSDB (HotSpot Debugger)
finalizable objects, printing details of, 103
FinalizerInfo, 103
heap, dumping, 103
HeapDumper, 103
JavaScript interface to Serviceability Agent, 108
JFR information, extracting, 107–108
JSDB (JavaScript Debugger), 108
loaded classes, dumping, 106–108
Object Histogram, 105
object histograms, collecting, 105
permanent generation statistics, printing, 103–104
PMap, 104
process maps, printing, 104
SOQL (Structured Object Query Language), 106
SOQL queries, executing, 106
Serviceability Agent, plugin for VisualVM
Find Value in CodeCache utility, 122–123
Find Value in Heap utility, 122–123
installing, 118
Java Stack Trace panel, 119–120
ordinary object pointers, inspecting, 120–121
Serviceability Agent, troubleshooting problems
postmortem analysis of core files, 136–143
postmortem analysis of HotSpot JVM crashes, 136–143
Shared library problems with transported core files, 109–110
Snapshot-at-the beginning (SATB), 30
SOQL (Structured Object Query Language), 106
SOQL queries, executing, 106
Sparse RSets, 25
Stop-the-world garbage collection, 2–4
sun.jvm.hotspot.debugger.useProcDebugger
, 111
sun.jvm.hotspot.debugger.useWindbgDebugger
, 111
sun.jvm.hotspot.debugger.windbg.disableNativeLookup
, 111
sun.jvm.hotspot.debugger.windbg.imagePath
, 111
sun.jvm.hotspot.debugger.windbg.symbolPath
, 111
sun.jvm.hotspot.jdi.SACoreAttachingConnector
, 113
sun.jvm.hotspot.jdi.SAPIDAHachingConnector
, 113
sun.jvm.hotspot.loadLibrary.DEBUG
, 111
sun.jvm.hotspot.runtime.VM.disableVersionCheck
, 111
sun.jvm.hotspot.tools.jcore.filter=<name of class>
property, 106–108, 111
sun.jvm.hotspot.tools.jcore.outputDir=<output directory>
property, 106–107
sun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=<list of packages>
property, 106, 111
sun.jvm.hotspot.tools.Tool
, 115
Survivor fill capacity, 19
Survivor regions, insufficient space causing evacuation failure, 60
Synchronization-related issues, 95
TAMS (top-at-mark-starts), 30–33
Tenuring threshold, live objects, 18, 19
Thread count, increasing, 54
Thread stack trace, displaying, 119–120
CMS (Concurrent Mark Sweep) GC, 6–7
setting number of, 146
Threads, interrupting
Parallel GC, 4
Serial GC, 5
Timed activities, variance in, 42
Top-at-mark-starts (TAMS), 30–33
To-space exhausted
log message, 53–54. See also Evacuation failures
To-space exhaustion. See Evacuation failures
To-space overflow. See Evacuation failures
Troubleshooting. See JDI (Java Debug Interface); Serviceability Agent
concurrent marking phase, 52–54
universe
command, 101
userdump
tool, 108
Version checking, disabling, 111
Version matching, 71
VisualVM. See Serviceability Agent
VM data structures, examining, 101
Weak references, excessive, correcting, 63
–XX:+ClassUnloadingWithConcurrentMark
, 36, 153
–XX:+CMSParallelInitialMarkEnabled
, 6
–XX:+CMSParallelRemarkEnabled
, 6
–XX:ConcGCThreads
, 34–35, 54, 146
–XX:G1ConcRefinementGreenZone
, 29, 148
–XX:G1ConcRefinementRedZone
, 29, 148
–XX:G1ConcRefinementThreads
, 29–30, 43
–XX:G1ConcRefinementYellowZone
, 29, 148
–XX:G1HeapRegionSize
, 19, 59, 146
–XX:G1HeapRegionSize=n
, 18
–XX:G1HeapWastePercent
, 23, 146–147
–XX:G1MaxNewSizePercent
, 17, 50–52
–XX:G1MixedGCCountTarget
, 23, 57, 147
–XX:G1MixedGCLiveThresholdPercent
, 58
–XX:G1NewSizePercent
, 17, 50–52
–XX:+G1PrintRegionLivenessInfo
, 147
–XX:+G1SummarizeRSetStats
, 44–47, 147
–XX:G1SummarizeRSetStatsPeriod
, 148
–XX:+G1TraceConcRefinement
, 148
–XX:+G1UseAdaptiveConcRefinement
, 148
–XX:+G1UseAdaptiveIHOP
, 151
–XX:+HeapDumpAfterFullGC
, 149
–XX:+HeapDumpBeforeFullGC
, 149
–XX:InitiatingHeapOccupancyPercent
default value, 11
description, 149
heap occupancy percentage, 22
occupancy threshold, default, 22
occupancy threshold, setting, 30
–XX:InitiatingHeapOccupancyPercent=n
, 52–54
–XX:MaxGCPauseMillis
, 17, 50–52, 151
–XX:MaxHeapFreeRatio
, 152
–XX:MaxTenuringThreshold
, 19
–XX:MinHeapFreeRatio
, 152
–XX:ParallelGCThreads
, 29–30, 35, 43, 54
–XX:+ParallelRefProcEnabled
, 62–63
–XX:+PrintAdaptiveSizePolicy
, 55, 59, 152
–XX:+PrintGCDetails
, 18, 27, 60–61
–XX:PrintGCTimeStamps
, 27
–XX:+PrintStringDeduplicationStatistics
, 151
–XX:+ResizeTLAB
, 153
–XX:SoftRefLRUPolicyMSPerMB=1000
, 63–64
–XX:StringDeduplicationAgeThreshold
, 150
–XX:TargetSurvivorRatio
, 19
–XX:+UnlockCommercialFeatures
, 154
–XX:+UnlockDiagnosticVMOptions
, 147, 153–154
–XX:+UnlockExperimentalVMOptions
, 154
–XX:+UseConcurrentMarkSweepGC
, 6
–XX:+UseG1GC
, 27
–XX:+UseG1GC
, 146
–XX:+UseSerialGC
, 5
–XX:+UseStringDeduplication
, 149–150
Young collection pauses
triggering, 18
Young collection pauses, live objects
liveness factor per region, calculating, 22–24
survivor fill capacity, 19
Young collections
concurrent marking phase, tuning, 52–54
evacuation failure, log messages, 53–54
increasing thread count, 54
marking threshold, setting, 54
phases, 39. See also specific phases
Young collections, parallel phase
activities outside of GC, 48
concurrent refinement threads, 42–43
definition, 39
evacuation, 47
external root region scanning, 42
reclamation, 47
RSets, and processed buffers, 42–44
RSets, summarizing statistics, 44–47
scanning nmethods, 44
start of parallel activities, 41
summarizing parallel activities, 48
variance in timed activities, 42
Young collections, serial phase
definition, 39
Young generation
initial generation size, setting, 50–52
maximum growth limit, setting, 50–52
pause time goal, setting, 50–52
resizing, 18
Yuasa, Taiichi, 30
3.141.37.10