-
Enhancement
-
Resolution: Fixed
-
P3
-
15
-
b27
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8248104 | 16 | Markus Grönlund | P3 | Resolved | Fixed | team |
There exist two service threads in the JFR framework that perform operations inside the VM. They are JavaThreads running in thread state "_thread_in_vm".
The JFR Recorder Thread no longer executes Java code, but participates in notify() for communication with other threads running in Java. With Event Streaming, this thread now runs much more frequently, mainly tasked with flushing memory contents to disk at a regular intervals.
The JFR Periodic Task Thread runs a subset of registered periodic tasks implemented in the VM. For example, it reads performance counters exposed by the operating system.
There is no reason safepoint synchronizations should need to wait for these threads to reach a safepoint poll in the VM and therefore we should attempt to exclude them from the safepoint protocol where possible.
For the JFR Periodic Task thread, since it originates from and also executes Java code ("_thread_in_Java"), the solution would be to switch it to "_thread_in_native" where possible inside the VM. It must still transition to "_thread_in_vm" for some parts, for example when submitting a safepoint operation.
The JFR Recorder Thread could possibly be changed from a JavaThread to a NamedThread, but depends on having a working notification mechanism with other Java threads. If an alternative to this is not possible, it should be fine to keep it as a JavaThread, letting it spend most of its lifetime as "_thread_in_native", performing transitions only for specific operations.
The JFR Recorder Thread no longer executes Java code, but participates in notify() for communication with other threads running in Java. With Event Streaming, this thread now runs much more frequently, mainly tasked with flushing memory contents to disk at a regular intervals.
The JFR Periodic Task Thread runs a subset of registered periodic tasks implemented in the VM. For example, it reads performance counters exposed by the operating system.
There is no reason safepoint synchronizations should need to wait for these threads to reach a safepoint poll in the VM and therefore we should attempt to exclude them from the safepoint protocol where possible.
For the JFR Periodic Task thread, since it originates from and also executes Java code ("_thread_in_Java"), the solution would be to switch it to "_thread_in_native" where possible inside the VM. It must still transition to "_thread_in_vm" for some parts, for example when submitting a safepoint operation.
The JFR Recorder Thread could possibly be changed from a JavaThread to a NamedThread, but depends on having a working notification mechanism with other Java threads. If an alternative to this is not possible, it should be fine to keep it as a JavaThread, letting it spend most of its lifetime as "_thread_in_native", performing transitions only for specific operations.
- backported by
-
JDK-8248104 JFR Recorder Thread to run in thread state "_thread_in_native"
- Resolved
- relates to
-
JDK-8243962 Various JVM TI tests time out using JFR on Windows
- Resolved
-
JDK-8248794 Transition JFR Periodic Task Thread to "_thread_in_native" before invoking performance counters
- Resolved
-
JDK-8249878 jfr_emergency_dump has secondary crashes
- Resolved
-
JDK-8247530 JfrCheckpointManager failed "assert(!SafepointSynchronize::is_at_safepoint()) failed: invariant"
- Closed
-
JDK-8247967 SparkExamples24H.java SIGSEGV in various places
- Closed
(1 relates to)