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

Jan S. github.com+924885+jpstotz at openjdk.java.net
Mon Sep 28 12:02:13 UTC 2020


On Thu, 24 Sep 2020 14:11:46 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:

>> @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

@aptmac I just noticed that you were not talking about the JVM running JMC but about the JVM JMC is connected to. That
makes a version check a bit more complicated, at least I don't see a way to do so with my limited knowledge on JMC.

My current approach uses a Getter in `org.openjdk.jmc.console.ui.tabs.threads.ThreadInfoCompositeSupport` that catches
potential `InvalidKeyException` that occur when enabling the Daemon column on a Java 8 VM.  In such a case a defined
error string like "Data not available" is returned and shown for each thread as value in the Daemon column.

Do you think this is a suitable approach?

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

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


More information about the jmc-dev mailing list