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

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

    XMLWordPrintable

    Details

      Backports

        Description

        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.

          Attachments

          1. global-monitoring-results.png
            72 kB
            Paul Hohensee
          2. jdk8-8185005.diff
            22 kB
            Paul Hohensee
          3. self-monitoring-results.png
            67 kB
            Paul Hohensee

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: