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.