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

JNI handle allocation failure not reported correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b08
    • CPU:
      generic
    • OS:
      generic

      Description

      Failure to allocate a JNI handle (due to malloc failure) is presently reported using vm_exit_out_of_memory (when creating a new JNIHandleBlock in JNIHandles::allocate_block). That's not the behavior described in the JNI specification, which says that for out of memory failures

      - NewGlobalRef will return NULL.

      - NewLocalRef may return NULL.

      - NewWeakGlobalRef will return NULL and throw OutOfMemoryError.

      - PushLocalFrame will return a negative number and a pending OutOfMemoryError.

      Note that OutOfMemoryError doesn't really seem like the right exception for running out of system memory, but that's what the JNI spec says.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dholmes David Holmes
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: