RFR: 8314091: Set native thread name for Java main thread

Yasumasa Suenaga ysuenaga at openjdk.org
Fri Aug 11 01:45:58 UTC 2023


On Thu, 10 Aug 2023 12:42:10 GMT, Yi Yang <yyang at openjdk.org> wrote:

> `cat /proc/<java_process>/task/<main thread>/comm` shows "java"
> 
> User wants it to be "main", just like any other JVM threads, which can be achieved by explicitly calling pthread_setname_np when spawning main thread at VM startup.

FYI: I proposed same enhancement in [JDK-8152690](https://bugs.openjdk.org/browse/JDK-8152690) 7 years ago, and it closed as "won't fix". We have to consider several cases to be created JVM instance - e.g. created by JNI.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15224#issuecomment-1674114973


More information about the hotspot-runtime-dev mailing list