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

java/nio/Buffer/DirectBufferAllocTest.java failed with "OutOfMemoryError: Cannot reserve 1048576 bytes of direct buffer memory (allocated: 134217728, limit: 134217728)"

XMLWordPrintable

      The following test failed in the JDK19 CI:

      java/nio/Buffer/DirectBufferAllocTest.java

      Here's a snippet from the log file:

      #section:main
      ----------messages:(4/296)----------
      command: main -XX:MaxDirectMemorySize=128m -XX:-ExplicitGCInvokesConcurrent DirectBufferAllocTest
      reason: User specified action: run main/othervm -XX:MaxDirectMemorySize=128m -XX:-ExplicitGCInvokesConcurrent DirectBufferAllocTest
      Mode: othervm [/othervm specified]
      elapsed time (seconds): 3.422
      ----------configuration:(0/0)----------
      ----------System.out:(1/93)----------
      Allocating direct ByteBuffers with capacity 1048576 bytes, using 16 threads for 5 seconds...
      ----------System.err:(20/1316)----------
      java.lang.RuntimeException: Errors encountered!
      at DirectBufferAllocTest.main(DirectBufferAllocTest.java:157)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:577)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:828)
      Suppressed: java.lang.OutOfMemoryError: Cannot reserve 1048576 bytes of direct buffer memory (allocated: 134217728, limit: 134217728)
      at java.base/java.nio.Bits.reserveMemory(Bits.java:178)
      at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:118)
      at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:332)
      at DirectBufferAllocTest.lambda$main$0(DirectBufferAllocTest.java:126)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      ... 1 more

      JavaTest Message: Test threw exception: java.lang.RuntimeException: Errors encountered!
      JavaTest Message: shutting down test

      STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Errors encountered!
      ----------rerun:(38/5593)*----------

            bpb Brian Burkhalter
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: