Currently, we call `Universe::before_exit()` before invoking `JvmtiExport::post_thread_end`. The `before_exit()` signals to the GCs that a shutdown has started. However, the subsequent call to `JvmtiExport::post_thread_end` may still execute code that requires memory allocation or may trigger GC activity. This limits how the GCs can react to the shutdown signal called in `before_exit()`.
Investigate moving the `Universe::before_exit()` call after `JvmtiExport::post_thread_end()`. Reordering would ensure that any allocations or GC activity caused during `post_thread_end()` occur under normal GC conditions, and only after that point would the GCs be signaled that shutdown is in progress.
Investigate moving the `Universe::before_exit()` call after `JvmtiExport::post_thread_end()`. Reordering would ensure that any allocations or GC activity caused during `post_thread_end()` occur under normal GC conditions, and only after that point would the GCs be signaled that shutdown is in progress.
- relates to
-
JDK-8366865 Allocation GC Pauses Triggered after JVM has started shutdown
-
- Open
-