JDK-8370130 : The JavaThread flag hide_from_external_view is used inconsistently
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jvmti
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-10-17
  • Updated: 2025-10-27
Related Reports
Relates :  
Relates :  
Description
The JavaThread flag hide_from_external_view is set for various threads including compiler threads. The intent is to hide threads with this flag from external view. However, it seems the JVMTI events can be posted on behalf of such threads. At least, I do not see any mechanism that prevents this to happen. We need to make the threads hiding mechanism to be consistent.
It is not clear if it is possible to skip all JVMTI events for threads with the flag hide_from_external_view. For instance, the ServiceThread has such flag but it is used to post deferred events originated by compiler threads. All JVMTI events hiding mechanisms have to be balanced properly and designed together.
Comments
Tracing the history, this was first introduced for Compiler threads under JDK-4529296, so that they could not be suspended and resumed (as part of JVMDI). I have no doubt that the notion of "hidden" has expanded in an ad-hoc way since then. But the fact we use the ServiceThread to report deferred events from compiler threads, shows that we still expect such events from hidden threads.
22-10-2025