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

Major performance regression in GetMethodDeclaringClass and other JVMTI Method functions

XMLWordPrintable

    • b01

        NOTE: This was fixed in Oracle JDK 8u281 only.

        Starting from JDK 8u112 certain JVMTI functions became extremely slow. All these functions accept jmethodID as an argument.

        - GetMethodName
        - GetMethodDeclaringClass
        - GetMethodModifiers
        - GetLineNumberTable
        - GetBytecodes

        etc.

        The attached code demonstrates the problem. This code executes GetMethodDeclaringClass one million times. It works 86 ms on JDK 8u102, but it takes 360'000 ms on JDK 8u141.

        The problem appeared after JDK-8147451. The fix introduced a validity check Method::is_method_id for each translation of jmethodID argument. This involves a linear search among all jmethodIDs. Various tools like profilers allocate jmethodIDs for many loaded classes, so that the total number of jmethodIDs may reach hundreds of thousands. Linear search is not going to work in such cases.

              fmatte Fairoz Matte
              apangin Andrei Pangin
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: