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

☂ Memory allocation failure should throw OOME

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx21
    • javafx
    • None

      When a memory allocation failure occurs in JNI calls such as New<PrimitiveType>Array, NewStringUTF, or NewDirectByteBuffer, an OutOfMemoryError (OOME) is thrown.

      Similarly, when a memory allocation failure occurs in native memory allocation method such as malloc, calloc, or "new (std::nothrow)", we should consider throwing OOME. This can be done either by calling the JNI ThrowNew method, or by returning an error code to the Java caller and having the Java code throw OOME. Generally, the former is preferred.

      This is an umbrella task. As we find issues, we will file a bug for each area of the code and link it as a blocking issue.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: