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

EnsureLocalCapacity() should maintain capacity requests through multiple calls

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 10
    • 9, 10
    • hotspot
    • b22
    • 9
    • b37

    Backports

      Description

        When multiple calls to EnsureLocalCapacity happen over the course of a java native method call (say, in the native method itself, as well as in a function called by the native method), an earlier request for a larger local capacity will be lost/overwritten by a later request for a smaller capacity.

        One result is that EnsureLocalCapacity calls can be ineffective for preventing the local ref warning issued under -Xcheck:jni ("WARNING: JNI local refs: XX, exceeds capacity: YY") because the request is "forgotten" due to subsequent (sometimes tricky to spot) calls to EnsureLocalCapacity.

        The attached test case demonstrates the problem when run with -Xcheck:jni.

        Attachments

          Issue Links

            Activity

              People

                dholmes David Holmes
                bchristi Brent Christian
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: