diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 67ca886..2719946 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -1580,7 +1580,13 @@ bool nmethod::is_unloading() { // The IsUnloadingBehaviour is responsible for checking if there are any dead // oops in the CompiledMethod, by calling oops_do on it. state_unloading_cycle = CodeCache::unloading_cycle(); - state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this); + + if (is_zombie()) { + // Zombies without calculated unloading epoch are never unloading due to GC. + state_is_unloading = false; + } else { + state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this); + } state = IsUnloadingState::create(state_is_unloading, state_unloading_cycle);