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

SegmentAllocator:allocate() can return null some cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • 19
    • core-libs

        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.

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

                Created:
                Updated:
                Resolved: