Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8185005

Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)

XMLWordPrintable

        The implementation of getThreadInfo(long ids[], int maxDepth) iterates over the ids array, calling Threads::find_java_thread_from_java_tid() for each one. find_java_thread_from_java_tid() does a linear search over the thread list, so if the ids array length is large, it can take quite some time to find the corresponding JavaThread*s. One idea is to add find_java_threads_from_java_tids() to get them all at once and have it put the content of the ids array into a set (hashtable, perhaps) for a "sufficiently large" ids array.

              dtitov Daniil Titov (Inactive)
              phh Paul Hohensee
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: