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

SegmentAllocator:allocate() can return null some cases

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 19
    • 19
    • core-libs

    Backports

      Description

        Observed that allocate(bytesSize) and allocate(bytesSize, alignment) might throw OutOfMemoryError when bytesSize is too long.

        IMO, this can be stated in spec.

        And also observed that allocate(bytesSize, alignment) can return null, with
        ====
         SegmentAllocator segmentAllocator = SegmentAllocator.newNativeArena(MemorySession.openConfined());
                MemorySegment memorySegment = segmentAllocator.allocate(Long.MAX_VALUE, 2);
                System.out.println(" The memorySegment is " + memorySegment);
        ====

        If this is a valid case Spec can be enhanced for this.

        Attachments

          Issue Links

            Activity

              People

                mcimadamore Maurizio Cimadamore
                kganapureddy Krushnareddy Ganapureddy
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: