Deoptimization Debugging: When JIT Compiled Code Reverts

Learn what causes the JVM to deoptimize JIT-compiled code, how to detect deoptimization events, and how to fix the underlying issues.

published: reading time: 25 min read author: Geek Workbench
Quick Summary

Learn what causes the JVM to deoptimize JIT-compiled code, how to detect deoptimization events, and how to fix the underlying issues.

Deoptimization Debugging: When JIT Compiled Code Reverts

The JVM’s JIT (Just-In-Time) compiler uses runtime observations to optimize hot code. When an assumption made by compiled code no longer holds, the JVM can deoptimize it and resume execution in an interpreter or less-optimized compiled code. The event is normal; whether it affects application latency depends on the method and workload.

This guide explains the different deoptimization types, how to detect them in production, and what typically causes them.

Introduction

Deoptimization is a transition, not a fixed slowdown. A thread may resume in interpreted code or at a lower compilation level, and the effect depends on how much work the method does before the JIT compiles it again. One event by itself does not establish a user-visible regression.

This guide shows how to inspect recorded deoptimization events and compare a warmed workload before and after a suspected change. Treat event counts as clues; use repeated measurements to decide whether the event matters.

Why the JIT Compiles and Then Deoptimizes

The JIT compiler’s job is to make your code run fast. To do this, it observes how your program actually runs and compiles hot code paths with aggressive optimizations. These optimizations are based on observations — or bets — about what the code will do.

Examples of JIT bets:

  • “This type check will always pass, so I can inline the method”
  • “This field will not change while this loop runs, so I can move it out of the loop”
  • “This branch is almost always taken, so I’ll specialize the compiled code for it”
  • “No exceptions will be thrown here, so I can skip exception handling overhead”

When the runtime discovers the bet was wrong, it must deoptimize: discard the compiled code and return to interpretation (or re-compile with different assumptions).

Types of Deoptimization

1. Type Profile Mismatch

The JIT inlines a method call based on observed types, but later encounters a different type. This section covers what happens when the JIT bets wrong on types, how to identify the failing call site, and what patterns in your code cause the profile to shift.

The JIT tracks type profiles at every virtual call site. During early execution, if a call site sees only one concrete type, the JIT promotes it to monomorphic and inlines the target method directly. This delivers massive speedups because there is no virtual dispatch overhead. The problem starts when a second type appears at that same call site. The JIT then has to fall back to virtual dispatch for all calls at that site, but first it has to abandon any compiled code that assumed the old type. The compiled code that inlined the original type’s method is invalidated and all threads executing it must return to interpretation.

// JVM sees only String for first 10000 calls, compiles assuming String
// Call 10001 passes an Integer - deoptimization triggered
Object process(Object input) {
    return input.toString(); // Inlined as if always String
}

This pattern is common in code that handles mixed input types, such as JSON libraries processing different value types, serialization frameworks dealing with object hierarchies, or plugin architectures where new implementations load at runtime. In JFR, these events appear with reason=type_check_profile_changed. The event’s BCI (bytecode index) field points to the exact bytecode instruction that failed, which you can cross-reference against javap -c output to find the source line. Look for call sites that receive broad Object types and get passed concrete implementations that may vary over time.

2. Uncommon Traps

An uncommon trap is a HotSpot mechanism for leaving compiled code at a path the compiler treated as uncommon. It is not a general branch-counter-overflow signal. The specific reason and action recorded depend on the JDK and the deoptimization site, so inspect the event fields from the JVM you are running instead of inferring a cause from the label alone.

If a method repeatedly deoptimizes after warmup, compare the JFR event’s method, bytecode index, reason, and action with the input pattern and application timeline. A rare path may have become common, but the event should be correlated with repeated latency or throughput changes before it is treated as a performance problem.

3. Class Hierarchy Change

The JIT compiler bakes its knowledge of the class hierarchy — the inheritance tree, interface implementations, and virtual method dispatch targets — into compiled code. When a new class loads that changes that hierarchy, every compiled method that relied on the old structure becomes invalid.

This typically happens in two scenarios. First, dynamic class loading: a new class is loaded at runtime that implements an interface the JIT had already seen, or a subclass is created of a class the JIT had compiled against. The new class changes the polymorphic call site from bimorphic to megamorphic, and the JIT can no longer inline — any compiled code that assumed a fixed set of type targets must be invalidated. Second, instrumentation-based class redefinition: tools like Arthas, custom JVMTI agents, or IDE debuggers call Instrumentation.redefineClasses to replace class bytecode in a running JVM. The JIT has compiled methods with field offsets, vtable entries, and method addresses that no longer correspond to the new class layout. Every compiled method touching that class is deoptimized with reason=class_load.

The performance impact is usually temporary. The JIT re-compiles with the new class information and recovers within minutes. In applications with heavy instrumentation or plugin architectures that load classes dynamically, however, this can be a recurring source of P99 spikes shortly after deployments. To confirm this is your cause, correlate deoptimization events with reason=class_load in JFR against deployment timestamps or class loading logs.

4. Speculative Checks and Type Profiles

HotSpot can optimize call sites using the types observed during profiling. If later executions violate an assumption used by compiled code, the JVM can deoptimize and resume with the required checks. A JFR event may identify the method and bytecode index, but the event does not by itself prove that a particular cast or call caused a user-visible slowdown.

Use the BCI as a starting point. Inspect the matching class file with javap -c -p, then compare the event timestamp with the request path, input types, and JIT compilation activity. Type profiles and deoptimization reasons are implementation details; avoid treating one reason string as a stable diagnosis across JDK releases.

Bailout and deoptimization are related but not interchangeable labels across JVM tools. A compilation bailout can mean the compiler did not produce a requested compilation; a deoptimization event describes execution leaving compiled code. Check the JDK’s own event or compiler-log documentation before mapping a message to a runtime cause. Do not increase diagnostic JVM limits as a first response; first establish that a repeatable workload regression exists.

When to Investigate Deoptimization

Symptoms That Point to Deoptimization

  • Periodic latency spikes: Deoptimization causes brief returns to interpretation, which shows up as latency spikes in your P99 metrics
  • JIT compilation bursts causing pauses: Re-compilation itself takes CPU and may trigger safepoints
  • Performance regression after warmup: Code runs fast, then inexplicably slows down
  • GC pauses correlated with latency but not GC: Class unloading can trigger deoptimization of methods that depended on old class structures

When Not to Worry

  • Startup phase: A certain amount of deoptimization is normal during warmup
  • Single events: One deoptimization here and there is usually fine
  • Tiered compilation activity: C1 to C2 promotion causes temporary deoptimizations

Architecture

graph TB
    subgraph "JIT Compilation Pipeline"
        Bytecode[Bytecode]
        C1[C1 Compiler<br/>Quick - Level 1/2]
        C2[C2 Compiler<br/>Optimizing - Level 3/4]
        Native[Native Code]
    end

    subgraph "Deoptimization Triggers"
        Trap[Uncommon Trap]
        Type[Type Profile<br/>Mismatch]
        Class[Class Load<br/>Hierarchy Change]
        Safepoint[Blocked<br/>Safepoint]
    end

    Bytecode -->|Interpreted| C1
    C1 -->|hot| C2
    C2 -->|compiled| Native
    Native -->|assumption violated| Trap
    Trap -->|bailout| Bytecode
    Type -->|bailout| Bytecode
    Class -->|invalidate| Native

Detecting Deoptimization Events

JFR records deoptimization events with causes:

# Print recorded deoptimization events from this recording
jfr print --events jdk.Deoptimization myrecording.jfr

# Filter only after checking the event fields emitted by your JDK
jfr print --events jdk.Deoptimization myrecording.jfr | grep -E 'reason|action|method'

JDK event schemas can change. In the OpenJDK 25 JFR metadata, jdk.Deoptimization includes fields such as compileId, compiler, method, lineNumber, bci, instruction, reason, and action (JDK 25 event metadata). A trimmed example of that schema looks like this; the values are placeholders, not a captured production event:

jdk.Deoptimization {
  compileId = <compile id>
  compiler = "<compiler>"
  method = <class>::<method>
  lineNumber = <source line>
  bci = <bytecode index>
  instruction = "<instruction>"
  reason = "<reason recorded by this JDK>"
  action = "<action recorded by this JDK>"
}

Some event types are not enabled in every recording configuration. Confirm that your recording contains the event before drawing conclusions from an empty result.

Via JVMTI / MBean

import java.lang.management.*;

public class DeoptDetector {
    public void checkCompilationMXBean() {
        CompilationMXBean mx = ManagementFactory.getCompilationMXBean();
        System.out.println("Compiler: " + mx.getName());
        System.out.println("Total compilation time: " +
            mx.getCompilerTotalTime() + " ms");

        // Note: CompilationMXBean does not expose deopt counts directly
        // Use -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation for text output
    }
}

Via JVM Print Flags

# Print every compilation and deoptimization event
java -XX:+UnlockDiagnosticVMOptions \
     -XX:+PrintCompilation \
     -XX:+PrintGCDetails \
     -XX:+PrintSafepointStatistics \
     -XX:PrintAssemblyOptions=intel \
     -jar myapp.jar 2>&1 | tee jit_output.log

Look for lines like:

DEOPT PACK = 2  # deoptimization at bytecode index 2

Interpreting PrintCompilation Output

The PrintCompilation output is dense but reveals exactly what the JIT is doing per method. Each line represents either a compilation event or a deoptimization event. Understanding the field layout helps you read it quickly without needing to parse it programmatically.

A typical compiled method line looks like this:

2    sun.reflect.GeneratedSerializationConstructorAccessor1::apply (43 bytes)

The fields are: compilation_id method_name (size). The number at the start is the compilation ID. made not entrant lines indicate deoptimization:

2    sun.reflect.GeneratedSerializationConstructorAccessor1::apply (43 bytes)
  made not entrant   # this method was deoptimized (inlined then invalidated)

made not entrant means a compiled method will not be used for new calls; the message alone does not identify why it was invalidated or prove a performance regression. Check the surrounding compilation log or JFR event, then compare its timing with application metrics. Repeated messages for a hot method are a reason to investigate, not a diagnosis.

Compare warmed workloads before and after a change

A JFR event is evidence that the JVM left compiled code; it does not quantify the effect on requests. To check a suspected regression, build the baseline and candidate revisions with the same JDK and run the same benchmark harness, input data, hardware, JVM flags, and concurrency. Warm each revision to steady state, repeat the runs, and record throughput, p50/p95/p99 latency, CPU use, and garbage-collection activity. Capture JFR for the same runs so event timing can be compared with the measurements.

Run Build or commit JDK and flags Warm-up Throughput p50 / p95 / p99 JFR notes
Baseline Record value Record value Record duration/iterations Measure Measure Note relevant events
Candidate Record value Same setup Same setup Measure Measure Note relevant events

Investigate when repeated candidate runs show a regression outside the baseline’s run-to-run variation and the event timeline points to the same hot method or code change. A single event, or a single noisy benchmark run, is not enough to attribute a latency change to deoptimization.

Trade-off Table

Aspect Interpreted C1 Compiled (L1/L2) C2 Compiled (L3/L4)
Startup speed Fastest Medium Slowest (compile time)
Peak speed Slowest Medium Fastest
Deoptimization recovery N/A Faster Slower
Memory for compilation None Low High
When to use Rarely run Frequently run at startup Hot steady-state

Observability Checklist

  • Enable JFR Deoptimization events in production recording
  • Alert when deoptimization rate spikes above baseline
  • Use jfr print --events Deoptimization to identify top deoptimized methods
  • Cross-reference deoptimization spikes with deployments or class loading events
  • Enable -XX:+PrintCompilation temporarily when investigating deopt issues
  • Look for deoptimization reasons: type_check_profile_changed, uncommon_trap, class_load, not entrant
  • Understand that some deoptimization during warmup is normal
  • Use -XX:MaxNodeLimit to prevent overly large compilation units that cause bailouts

Security Notes

Deoptimization debugging data reveals internal JVM behavior that may be useful to attackers:

  • Compiled code addresses: Can reveal code layout and potentially be used for ROP attacks
  • Method profiling data: Reveals which code paths are hot, exposing business logic
  • Class loading patterns: Reveals what classes are loaded, potentially exposing plugins or dynamic code

Best practices:

  • Restrict access to deoptimization logs and JFR recordings to authorized operations staff
  • Be aware that JIT debug output (-XX:+PrintCompilation) can reveal method names and bytecode indices in production
  • Sanitize any performance data before sharing externally

Common Pitfalls / Anti-Patterns

Pitfall 1: Chasing Normal Warmup Deoptimization

Problem: You see deoptimization events and think something is broken.

Explanation: A certain number of deoptimizations during the first few minutes of an application’s life is completely normal. The JIT starts with no profiling data, compiles aggressively, then has to fall back when real-world usage reveals previously unseen behaviors.

Fix: Establish a baseline of normal deoptimization rates during stable production, then alert on deviations from that baseline.

Pitfall 2: Misreading PrintCompilation Output

Problem: You see “made not entrant” and panic.

Explanation: “Made not entrant” means the JIT invalidated a compiled method because assumptions changed. This is usually transient and the method will be re-compiled. It does not mean your application crashed or leaked memory.

Fix: Correlate with latency metrics. If latency is fine, a few “made not entrant” lines are nothing to worry about.

Pitfall 3: Disabling JIT to Avoid Deoptimization

Problem: You add -Xint to force interpreted mode and avoid deoptimization.

Explanation: Interpreted and compiled performance varies by code and workload. A deoptimization event alone does not establish how much a request or service slowed down. Forcing interpreted mode with -Xint changes the whole runtime and is not a sound way to diagnose one suspected regression.

Fix: Find and fix the cause of excessive deoptimization, do not disable compilation.

Pitfall 4: Deoptimization vs. Re-optimization Confusion

Problem: You think deoptimization means the JIT is broken.

Explanation: Deoptimization is the JIT correcting a bad bet. Re-optimization (re-compilation) is the JIT trying again with better information. The system is working as designed.

Fix: If deoptimizations are excessive for a specific method, look for code patterns that confuse the JIT (polymorphic calls, volatile access, unusual branching).

Quick Recap Checklist

  • Deoptimization happens when JIT assumptions about code behavior are violated
  • JFR Deoptimization events show which methods deoptimized and why
  • Common reasons: type profile mismatch, uncommon trap, class load
  • Startup deoptimization is normal; production spikes warrant investigation
  • “Made not entrant” means invalidated compiled code, not a crash
  • Use -XX:+PrintCompilation for detailed per-event tracing during debugging
  • Do not infer a cause or user impact from one deoptimization event
  • -Xint forcing interpretation is not a fix — it makes everything slow
  • Cross-reference deopt spikes with deployments and class loading events
  • The JIT re-optimizes after deoptimization; let it recover naturally

Interview Questions

1. What is deoptimization and why does the JVM do it?

The JIT optimizes code using runtime observations and assumptions. When compiled code can no longer rely on an assumption, the JVM can deoptimize and resume in an interpreter or a less-optimized compiled version. This is a normal runtime transition; its performance effect depends on the method and workload.

2. How do you detect deoptimization events in a running JVM?

Java Flight Recorder is the best approach for production. Enable Deoptimization events in your recording and use jfr print --events Deoptimization to see the events with their reason field explaining why each deoptimization occurred. For deep debugging, -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation prints every compilation and deoptimization event to stderr. The output includes the method name, bytecode index (Bci), and reason for deoptimization. In a running JVM, check the CompilationMXBean for compilation timing, but note it does not expose deoptimization counts directly.

3. What is an "uncommon trap" deoptimization?

In HotSpot, an uncommon trap is a mechanism for leaving compiled code at a path treated as uncommon. It is not synonymous with a compiler failure or branch-counter overflow. Read the event's method, bytecode index, reason, and action for the JDK in use. Repeated events may be worth investigating if they coincide with measured changes in a warmed workload.

4. How does class redefinition trigger deoptimization?

When you use instrumentation agents to redefine classes in a running JVM (using Instrumentation.redefineClasses), the JIT has compiled code that assumes the old class structure. Field offsets, method addresses, vtable entries, and type information baked into the compiled code become invalid. The JVM must invalidate all compiled code that depended on the old class definition. This generates deoptimization events with reason=class_load. The JIT will re-compile affected methods using the new class definition. This is why you often see a brief performance dip after deploying with instrumentation-based tools. It is normal and the JIT recovers, but it can take some time for peak performance to return if the redefinition affects hot methods.

5. How does deoptimization affect latency-sensitive applications?

There is no fixed slowdown factor. The thread may resume in interpreted code or at a lower compilation level, and the effect depends on how much work runs before recompilation and on the workload. Compare repeated warmed baseline and candidate runs with the same JDK, input, hardware, and JVM settings. Correlate any latency or throughput change with JFR events; do not treat one event as proof of cause.

6. How does tiered compilation (C1 and C2) interact with deoptimization?

Modern JVMs use tiered compilation with four levels: interpreted code (L0), C1 compiled with profiling (L1), C1 compiled full optimization (L2), and C2 compiled code (L3/L4). When a method's profiling data shows it is hot, it gets promoted through tiers. Deoptimization can occur when: a method in L3/L4 violates assumptions and must revert to L2 (not interpretation), a C2 method exceeds node or loop limits and bails out to L1, or a L2 method's profiling counters overflow triggering recompilation. After deoptimization, the method re-enters the compilation pipeline with better profiling data — this is why warmup deoptimizations are normal.

7. What is the "uncommon trap" mechanism and how does it relate to branch prediction?

An uncommon trap lets HotSpot leave compiled code at a path it treated as uncommon. It is not a direct measurement of hardware branch prediction, and the reason recorded depends on the JVM version and site. Inspect the event fields, then check whether repeated events align with a measured workload regression.

8. How does the JIT handle deoptimization of monomorphic vs polymorphic call sites?

A monomorphic call site has observed one concrete receiver type in the profile; a polymorphic site has observed more. HotSpot can use those profiles when optimizing a call, but the exact decisions are compiler- and version-dependent. A new type may change compilation behavior or trigger deoptimization, but it does not guarantee a regression. Measure the affected workload and inspect the event from the JDK in use.

9. What is the difference between a bail-out and a deoptimization in the JVM?

A bail-out is when compiled code cannot continue executing in its current form and must transition — but not necessarily back to interpretation. A bail-out might trigger on-stack replacement (OSR) where a running interpreted method is replaced by a compiled version mid-execution. A deoptimization specifically means reverting to interpreted execution or less-optimized compiled code. Bail-out typically means "I cannot compile this path efficiently right now" and the code continues at a lower optimization level. Deoptimization means "my assumptions were wrong" and the code must fall back. In practice the terms are often used interchangeably in JIT documentation.

10. How does the JVM's LoopOpts and MaxNodeLimit affect deoptimization?

-XX:MaxNodeLimit (default 80000) caps the number of IR nodes the JIT will create for a single compiled method. When a method's compilation exceeds this limit, the compiler bail-outs and generates less optimized code. Similarly, -XX:LoopOptsCount and loop-related flags limit loop transformations. These limits exist because overly large compilations cause long compile times and excessive memory use. Methods that hit these limits tend to deoptimize more often because the resulting code is less optimized. If you see a specific method repeatedly deoptimizing with reason "code too large," raising MaxNodeLimit may help, but at the cost of longer compile times.

11. How does GraalVM compare to HotSpot C2 in terms of deoptimization behavior?

GraalVM uses a different compilation architecture than HotSpot's C2. It performs ahead-of-time (AOT) compilation via GraalVM Native Image and supports JIT via the GraalVM JIT compiler (used in GraalVM's JVM). GraalVM tends to have different deoptimization triggers — it uses partial escape analysis more aggressively, which means different patterns of scalar replacement and allocation elimination. GraalVM's deoptimization reasons are similar but the heuristics differ. When migrating between HotSpot and GraalVM, you may see different deoptimization frequencies and patterns. GraalVM also exposes more compile-time information which can make deoptimization debugging easier.

12. What is the "zombie code" phenomenon in JIT deoptimization?

Zombie code occurs when a compiled method is deoptimized but the JVM still has stack frames from the old compiled code on the call stack. When those frames eventually unwind, they land in the new compiled version (or interpretation) of the method. This is normal and handled by the JVM's nmethod management — deoptimized code is marked "not entrant" meaning no new calls will go to it but existing activations can complete. The "made not entrant" message in PrintCompilation output is exactly this zombie state — the code is being cleaned up as stack frames return.

13. How do you identify which bytecode index (bci) caused a deoptimization?

The JFR Deoptimization event and PrintCompilation output include a BCI (bytecode index) value. To find the corresponding bytecode: disassemble the class with javap -c -p ClassName which shows bytecode index labels. The BCI in the deoptimization output matches the bytecode index in the javap output. You can also use the JITWatch tool which visualizes compilation logs and links BCI values back to source code. With the BCI, you identify exactly which bytecode instruction triggered the deoptimization — whether it is a specific field access, method call, or conditional branch.

14. How does biased locking revocation cause deoptimization?

Biased locking eliminates lock overhead for uncontended locks by giving a thread a "bias" toward a lock object. When a second thread tries to acquire a biased lock, the bias must be revoked — this is done via a safepoint operation that includes deoptimization of any methods that had lock operations on that object. If many objects are heavily biased and then accessed by multiple threads (e.g., after a load balancer routes requests differently), mass bias revocation can cause coordinated deoptimization spikes. The JVM's adaptive biased locking tries to avoid this but it can still happen on first contact with previously-biased objects.

15. What is the relationship between deoptimization and on-stack replacement (OSR)?

On-stack replacement (OSR) is when the JVM replaces a running method's code while it is actively executing — the current stack frame is replaced mid-flight. OSR often follows deoptimization: a method is running interpreted, gets compiled, and then if it is still running when the compiled version is ready, OSR switches to the compiled version. Conversely, if a compiled method hits a deoptimization, OSR might switch back to interpretation. OSR is why you can profile a long-running method and see it transition from interpreted to compiled mid-execution — this is normal and not an error.

16. How does Inline Tree size affect compilation and deoptimization?

The JIT compiler tracks an "inline tree" of all methods that get inlined into a compiled method. The root is the compiled method, and each inlined call adds a child node. Large inline trees mean the compiled method covers more code but also make the compilation more expensive and increase the chance of hitting node limits. -XX:MaxInlineLevel controls how deep the inline tree can go (default 9). When the inline tree exceeds size limits or contains methods that trigger deoptimization, the entire compiled method may be invalidated. Methods with very deep call chains (like recursive utility libraries) are prone to inline tree issues.

17. What is the "stress" testing mode for deoptimization and when is it useful?

-XX:+DeoptimizeRandom randomly deoptimizes methods to stress test the JVM's deoptimization infrastructure. This is used by JVM developers to find bugs in the deoptimization handling code itself. For application developers, this flag is not useful for production — it artificially increases deoptimization rates to find latent bugs in the JVM. Similarly, -XX:DeoptimizeALot forces frequent deoptimization. These flags are debugging aids, not performance tools. If you want to test your application's behavior under deoptimization, use JFR to observe real deoptimizations rather than creating artificial ones.

18. How does the JVM handle deoptimization of code using CPU-specific intrinsics?

The JVM includes intrinsics — hand-written assembly for specific methods like System.arraycopy, String.equals, or Math.sin. These intrinsics use CPU-specific instructions (e.g., SIMD). If the JIT compiles a method using an intrinsic but the CPU does not support the required instructions (e.g., the code runs on a different machine type than where it was compiled), the compiled code must deoptimize. This is rare in practice because intrinsics are typically used only when the CPU supports them. -XX:UseSSE and similar flags control which intrinsics are available.

19. What is the difference between a null check deoptimization and a class cast deoptimization?

Null check deoptimization happens when the JIT inlines a method call on an object that it believed was non-null (based on prior checks), but a null was encountered. The compiled code had eliminated the explicit null check assuming the type check implied non-null. When null appears, the null check is re-inserted and the compiled code is invalidated. Class cast deoptimization (checkcast failure) occurs when the JIT inlines based on an assumed type profile but encounters an unexpected type — the checkcast fails and the inlined code is invalidated. Both are type profile mismatches but apply to different scenarios: null vs type mismatch.

20. How does deoptimization interact with the JVM's method Handle API?

The Method Handles API (java.lang.invoke) allows dynamic method dispatch with arbitrary transformation chains (as, cast, filter, fold). When the JIT encounters a Method Handle call site, it initially treats it as a monomorphic call and may inline the target. If the MethodHandle chain is mutated at runtime (common in dynamic languages running on the JVM, or in some reflection-heavy frameworks), the inlined assumptions become invalid and deoptimization occurs. This is a known cause of deoptimization spikes in applications that use MethodHandles heavily for functional-style programming or dynamic proxies.

Further Reading

Conclusion

Deoptimization lets the JVM leave compiled code when it can no longer use an optimization as compiled. Inspect recorded JFR fields for the JDK in use, then compare warmed baseline and candidate runs before attributing a latency or throughput change to the event. Warmup activity is common; investigate when repeated measurements and event timing point to the same method or change.

Category

Related Posts

JIT Compilation Internals

See how HotSpot tiered compilation works in JDK 25, how to inspect warmup, and when JFR or compilation logs can guide tuning.

#java #jit #jvm

JIT Optimization in Java: Inlining and Escape Analysis

See how HotSpot handles inlining, escape analysis, scalar replacement, and dead code elimination, and how to inspect JIT behavior.

#jvm #jit #compiler-optimization

JVM Stack Walking API: Fast Stack Traversal and Security Context

A guide to the JVM Stack Walking API showing how to efficiently traverse stack frames, access local variables, and extract security context without the overhead of traditional stack trace capture.

#java #jvm #stack-walking