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

David Holmes dholmes at openjdk.org
Fri Aug 11 02:27:28 UTC 2023


On Fri, 11 Aug 2023 01:26:57 GMT, Yasumasa Suenaga <ysuenaga 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.

Thanks for that reminder @YaSuenag I had forgotten about the additional issues that can arise.

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

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


More information about the hotspot-runtime-dev mailing list