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

EnsureLocalCapacity() should maintain capacity requests through multiple calls

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Introduced In Build:
      b22
    • Introduced In Version:
      9
    • Resolved In Build:
      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

                • Assignee:
                  dholmes David Holmes
                  Reporter:
                  bchristi Brent Christian
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: