OnCallReadyStart learning

JVM Internals: glossary

39 terms, in plain words, with where each one is taught.

async-profiler (flame graph)
A popular profiler that shows where a Java process spends its CPU, usually drawn as a flame graph. Lesson 25.22
attach mechanism (attach, attach API, .java_pid)
How jcmd and friends talk to a running JVM: a SIGQUIT plus a socket in /tmp. Only the JVM's own user or root may attach. Lesson 25.3
bytecode
The instructions the Java compiler produces: not machine code for a real CPU but for the JVM, which runs them on any machine. Lesson 25.1
class (classes)
In Java, the blueprint of a kind of thing: its code and the fields it holds. Classes are loaded into the JVM at startup and on demand. Lesson 25.1
class histogram (histogram, GC.class_histogram, jmap -histo)
A table of classes by number of live objects and bytes; two a few minutes apart show which class grows. Lesson 25.28
committed (committed heap)
Memory the JVM has actually asked the operating system for (it counts in RSS), as opposed to reserved address space it may use later. Lesson 25.1
deadlock
Two (or more) threads each holding a lock another one needs, all waiting forever. Thread dumps report it as "Found one Java-level deadlock". Lesson 25.22
Eclipse MAT (MAT, Memory Analyzer)
Eclipse Memory Analyzer: a desktop tool that opens heap dumps and finds what keeps memory alive (Leak Suspects, dominator tree). Lesson 25.28
ephemeral container (kubectl debug -it)
A temporary container added to a running pod for debugging (kubectl debug), which can see the app's processes. Lesson 25.3
ergonomics
The defaults the JVM computes at startup from the CPUs and memory it can see: heap size, collector, GC threads. Lesson 25.2
G1 (G1GC, UseG1GC, garbage-first)
The default Java garbage collector on servers: splits the heap into regions and aims for short, predictable pauses. Lesson 25.1
GC log (-Xlog:gc, unified logging, Xlog)
A file with one line per collection (before->after heap, pause time), switched on with -Xlog:gc*:file=PATH. Lesson 25.13
GC roots (GC root, path to GC roots, dominator tree)
GC roots are what the collector starts from (thread stacks, static fields); an object stays alive while a path leads to it from a root. The dominator tree shows who keeps the most memory alive. Lesson 25.28
heap (Java heap)
The memory area where Java objects live, capped by -Xmx or MaxRAMPercentage. Only part of a JVM process's memory. Lesson 25.1
HotSpot
HotSpot is the standard JVM; OpenJDK is its open-source build, what apt installs as openjdk-21-*. Lesson 25.1
hsperfdata (hsperfdata_)
Files in /tmp/hsperfdata_USER/ where each JVM publishes its performance counters; jstat reads them without attaching. Lesson 25.3
humongous (humongous object)
In G1, an object bigger than half a region; it is placed directly in the old generation. Lesson 25.1
JFR (Java Flight Recorder, JFR.start)
Java Flight Recorder: a low-overhead recording of what a JVM does (CPU per method, allocations, locks), started with jcmd PID JFR.start. Lesson 25.17
jstack (jmap, jinfo, jps)
Older JDK tools: jstack prints a thread dump, jmap histograms and heap dumps, jinfo reads and sets flags, jps lists JVMs. Lesson 25.3
jstat (jstat -gcutil, YGC, FGC)
Prints the JVM's GC counters live: space usage in %, young (YGC) and full (FGC) GC counts and total GC time (GCT). Lesson 25.17
JVM flag (-XX:, -XX:+, flag)
An option on the java command line; -XX:+Name switches a feature on, -XX:-Name off, -XX:Name=value sets a value. Lesson 25.2
live set (after-GC, heap after GC)
The heap still in use right after a collection - the objects really alive. A live set that keeps growing means a leak. Lesson 25.13
lock (monitor, locks, synchronized)
A guard only one thread can hold at a time; other threads that want it wait (BLOCKED) until it is released. Lesson 25.20
manageable flag (manageable)
A JVM flag that can be changed in a running JVM with jinfo -flag, such as HeapDumpOnOutOfMemoryError.
memory leak (leak)
Objects that should be freed are still referenced by something, so the live set grows until the heap is full. Lesson 25.28
method (methods)
A function that belongs to a Java class. Lesson 25.20
minor GC (young GC, mixed GC, full GC)
Young (minor) GC cleans only the young generation, mixed GC also some old regions, full GC the whole heap - the slow, expensive one. Lesson 25.12
nid (tid)
In a thread dump, nid is the operating-system thread id in hex - the same number top -H shows in decimal. Lesson 25.20
object (objects, instance, instances)
One thing created from a class while the program runs (an order, a request, a string). Objects live in the heap. Lesson 25.1
old generation (old gen, tenured, tenuring)
The part of the heap for objects that survived several young collections (they were "tenured"). Collected less often and more expensively. Lesson 25.1
PrintFlagsFinal (-XX:+PrintFlagsFinal)
java -XX:+PrintFlagsFinal -version prints every JVM flag with its final value and where it came from (default, ergonomic, command line). Lesson 25.2
Serial GC (UseSerialGC, Parallel GC, ZGC)
Other collectors: Serial (one thread, picked silently on small machines), Parallel (throughput, long pauses), ZGC (very short pauses on big heaps). Lesson 25.2
Spring MVC (MVC)
The classic part of Spring for web apps: one thread per request, a controller method answers it. MVC = model-view-controller, a way to split the code. Lesson 25.8
stack (ThreadStackSize)
Each thread's own memory for its method calls and local variables; set by -Xss, about 1-2 MB reserved per thread. Lesson 25.1
stop-the-world (pause, GC pause)
A pause in which every application thread is frozen while the collector works. Requests wait for the whole pause. Lesson 25.12
thread dump (Thread.print)
A snapshot of every thread in a JVM with its state and stack trace, taken with jcmd PID Thread.print, jstack or kill -3. Lesson 25.20
thread leak
A program that keeps creating threads and never ends them; RSS and the thread count climb while the heap stays flat. Lesson 25.22
thread state (BLOCKED, WAITING, TIMED_WAITING)
RUNNABLE = running or inside a native call such as a socket read, BLOCKED = waiting for a lock, WAITING/TIMED_WAITING = parked until woken or a timeout. Lesson 25.20
young generation (young gen, eden, survivor)
The part of the heap where new objects are born (eden) and short-lived survivors wait (survivor spaces). Collected often and cheaply. Lesson 25.1