Scrivio Interview library
ConceptFoundations7 min read · updated 12 November 2026

In -XX:+PrintCompilation output, what does made not entrant mean, and why would a method be compiled more than once?

Made not entrant means a compiled version of a method has been invalidated: new calls no longer enter it and go to the interpreter or to a newer compilation, while calls already running in it finish or are deoptimised. It happens when an assumption made during compilation fails, for example a type profile or a branch that was never taken, and routinely when a method moves up a tier and its C1 code is replaced by C2 code. So a method can be compiled several times, each time with better or updated profile information.

Why this question is asked

Anyone who runs -XX:+PrintCompilation for the first time sees made not entrant scrolling past and wonders whether something is broken. Usually nothing is: it is the normal life cycle of compiled code in an adaptive JIT. Interviewers ask it to check that we understand speculation and tiering, and that we can tell normal churn from a real problem. In this answer, we will recap what compiled code is and how calls reach it, explain what made not entrant does, go through the two main reasons it happens, see why recompilation follows, and mention the older zombie state.

1A Quick Recap of Compiled Code and Entry

When the JIT compiles a method, the native code is stored in an area of memory called the code cache, and the method is updated so that calls jump to that code instead of the interpreter. Each compiled version is called an nmethod in HotSpot terms. A method can have several versions over its life, for example a C1 version and later a C2 version, but only one is the current entry point for new calls.

With tiered compilation, every method starts interpreted, warm methods get a C1 version with profiling, and hot methods get a C2 version optimised using that profile. Each step creates a new compiled version, which means an old one has to be retired.

2What Made Not Entrant Means

Made not entrant marks a compiled version as closed for new business. The JVM patches the start of that code so that any new call into it is redirected, either to the interpreter or to the new compiled version if one exists. Calls that are already executing inside the old code are not killed. If the old code is being retired because a newer version exists, those calls simply run to completion. If it is retired because its assumptions are now wrong, the frames are deoptimised: converted into interpreter frames so execution continues correctly.

Later, when no thread is executing the old code any more, the JVM frees its space in the code cache.

Shell
java -XX:+PrintCompilation -jar app.jar
// time id attrs level method
// 210 88 3 com.shop.Cart::total (64 bytes)
// 1340 517 4 com.shop.Cart::total (64 bytes)
// 1341 88 3 com.shop.Cart::total (64 bytes) made not entrant <- C1 version retired
// 5022 517 4 com.shop.Cart::total (64 bytes) made not entrant <- C2 assumption failed
// 5030 951 3 com.shop.Cart::total (64 bytes) <- profiling again
// 6120 988 4 com.shop.Cart::total (64 bytes) <- new C2 version

Notice the two different reasons in the example. At 1341 ms, the level 3 version is retired because C2 just produced a better one; that is tier promotion. At 5022 ms, the C2 version itself is retired, and the method goes back to profiling and gets a new C2 version at 6120 ms; that is a failed speculation.

3Reason 1: A Speculative Assumption Failed

C2 compiles optimistically. If the profile shows that a branch was never taken, C2 does not compile it at all; it leaves an uncommon trap, a small stub that triggers deoptimisation if the branch is ever reached. If a call site has only ever seen one receiver class, C2 inlines that class's method behind a quick type check. If a class hierarchy has only one implementation of an interface loaded, C2 may call it directly.

These assumptions make code much faster, but they can become false. A request with a rare flag takes the branch that never ran, or a second implementation class is loaded. When that happens, the JVM deoptimises the affected frames and marks the compiled method not entrant, because code built on a false assumption cannot be used safely again.

Step throughLife of a compiled method
  1. C1 level 3 codeprofiles the method
  2. C2 level 4 codelevel 3 version made not entrant
  3. An assumption fails?
    Yesdeoptimise, C2 version made not entrantNokeeps running
  4. Back to interpreter or level 3profile now includes the new behaviour
  5. New C2 compilationwith the updated profile

5 steps in order. Play them, or step through them one at a time.

4Reason 2: Moving Up the Tiers

The other common reason is completely normal. When C2 finishes compiling a method that was running as C1 code, the C1 version is no longer needed. It is made not entrant so new calls go to the C2 version. In a busy service during warmup, thousands of these lines appear, and they are a sign that the JIT is doing its job. The same happens when a level 2 version is replaced by a level 3 version, and when an on-stack replacement version is superseded.

5Why the Method Is Compiled Again

After a failed speculation, the method still needs fast code. It returns to the interpreter or to a profiling tier, where the profile now records the new behaviour: the branch has been taken, a new receiver type has appeared. When the counters cross the threshold again, C2 recompiles it, and this time it does not make the assumption that failed. So recompiling is how the JIT adapts to what the program really does.

The JVM also protects itself against endless cycles. If a method is deoptimised for the same reason too often, the JIT stops making that kind of speculation in it, and after a large number of recompilations (PerMethodRecompilationCutoff, 400 by default in current JDKs, check your version) it gives up and leaves the method interpreted, which is shown as made not compilable.

6The Older Made Zombie State

In older JDKs, PrintCompilation also showed made zombie. A not-entrant method went through a zombie state once no thread used it any more, and the code cache sweeper freed it later. The sweeper and the zombie state were removed around JDK 20, when the code cache moved to a different cleanup mechanism, so on JDK 21 and 25 we see only made not entrant. Check your version if you read old logs or old tutorials.

7Follow-up questions

Is seeing many made not entrant lines a problem?

During warmup, no: most of them are C1 versions being replaced by C2 versions. It becomes a problem if the same method is made not entrant and recompiled again and again in steady state, which means its behaviour keeps contradicting the JIT's assumptions. JFR's deoptimisation events show the method and reason, so we can see whether it is the same few methods repeatedly.

What is the difference between not entrant and deoptimisation?

Deoptimisation converts running compiled frames back into interpreter frames so execution can continue without the compiled code. Making a method not entrant stops new calls from entering a compiled version. A failed speculation usually causes both: the frame that hit the trap is deoptimised, and the compiled method is made not entrant. Tier promotion causes only the second.

Can loading a class make code not entrant?

Yes. If C2 relied on class hierarchy analysis, for example that an interface has only one loaded implementation, loading a second implementation invalidates that assumption. The JVM finds all compiled methods that depended on it and makes them not entrant, which is why loading plugins or new features at runtime can cause a burst of recompilation.

8Conclusion

In this answer, we saw that made not entrant means a compiled version of a method stops accepting new calls, which go to the interpreter or a newer version, while running frames finish or are deoptimised. It happens when a speculative assumption such as a type profile or a never-taken branch fails, and routinely when C2 code replaces C1 code. The method is then recompiled with an updated profile, with cutoffs against endless cycles. The made zombie state belongs to older JDKs.

What to say in the interviewAbout 90 seconds aloud

Open with

Made not entrant means a compiled version of a method has been invalidated for new calls. The JVM patches its entry so that new calls go to the interpreter, or to a newer compiled version if there is one.

Then, if they want more

Threads already running in it either finish there, if the code was simply superseded, or get deoptimised into interpreter frames, if its assumptions are wrong. There are two main reasons.

The normal one is tier promotion: with tiered compilation a hot method first gets a C1 version with profiling, then C2 compiles it, and the C1 version is made not entrant because the C2 one is better. During warmup you see lots of these and that is fine. The other reason is a failed speculation.

C2 compiles using the profile: it may leave a never-taken branch as an uncommon trap, inline the one receiver type it saw, or rely on class hierarchy analysis.

If a request takes that branch or a new class shows up, the code is deoptimised and made not entrant, the method goes back to profiling, and it is recompiled later with the new behaviour in the profile. That is why a method can be compiled several times.

In older JDKs you also saw made zombie, which was removed with the sweeper around JDK 20.

About this answer

Last updated
12 November 2026
Versions it names
Java 20, Java 21
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "In -XX:+PrintCompilation output, what does made not entrant mean, and why would a method...": https://scrivio-interview-library.netlify.app/java/jit-compilation/f543a75d05/