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

EnsureLocalCapacity() should maintain capacity requests through multiple calls

XMLWordPrintable

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

        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.

          1. EnsureCapTest.cpp
            0.7 kB
            Brent Christian
          2. EnsureCapTest.java
            0.4 kB
            Brent Christian

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

                Created:
                Updated:
                Resolved: