RFR: 6913: Add daemon thread information to the console threads view

Alex Macdonald aptmac at openjdk.java.net
Mon Sep 28 12:02:10 UTC 2020


On Thu, 24 Sep 2020 08:27:59 GMT, Jan S. <github.com+924885+jpstotz at openjdk.org> wrote:

>> Hi @jpstotz !
>> 
>> The new daemon column looks okay and works well. Having said that, this won't work on jvms running on jdk8 [0]; the
>> daemon information is added to `java.lang.management.ThreadInfo` as of jdk9 [1], and trying to use this column on a
>> jdk8 jvm results in an error dialog (which when paired with the polling nature of the console pages makes this rather
>> difficult to close jmc).  Let me know if you need a JIRA issue created for this PR and I can set one up.
>> [0] https://docs.oracle.com/javase/8/docs/api/java/lang/management/ThreadInfo.html
>> [1] https://docs.oracle.com/javase/9/docs/api/index.html?java/lang/management/ThreadInfo.html
>
> @aptmac Thanks for reviewing my patch.
> I had not noticed that there is a Java version restriction on the used ThreadInfo class. As (daemon) threads are
> nothing new in Java this is really a surprise to me that this information is not available on Java 8. But now it makes
> perfectly sense why jmc did not already provide such a column.   As mitigation I would assume that the best way would
> be to check the Java version number before adding the `isDaemon` in
> `org.openjdk.jmc.console.ui.tabs.threads.ThreadTableSectionPart`. Hopefully the other definitions in
> ThreadInfoCompositeSupport don't cause any problems if not used.   I will check this out and update my patch.
> 
> Regarding the JIRA issue this would be nice of you.

@jpstotz Great, I've created a JIRA issue for this enhancement, it can be found at:
https://bugs.openjdk.java.net/browse/JMC-6913

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

PR: https://git.openjdk.java.net/jmc/pull/110


More information about the jmc-dev mailing list