Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectBufferAllocTest.java causes OOM #1859

Open
adamfarley opened this issue Jun 30, 2020 · 2 comments
Open

DirectBufferAllocTest.java causes OOM #1859

adamfarley opened this issue Jun 30, 2020 · 2 comments
Labels
Projects

Comments

@adamfarley
Copy link
Contributor

adamfarley commented Jun 30, 2020

Describe the bug
OOM produced by DirectBufferAllocTest.java

01:02:03  Allocating direct ByteBuffers with capacity 1048576 bytes, using 40 threads for 5 seconds...
01:02:03  STDERR:
01:02:03  java.lang.RuntimeException: Errors encountered!
01:02:03  	at DirectBufferAllocTest.main(DirectBufferAllocTest.java:157)
01:02:03  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
01:02:03  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
01:02:03  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
01:02:03  	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
01:02:03  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
01:02:03  	at java.base/java.lang.Thread.run(Thread.java:832)
01:02:03  	Suppressed: java.lang.OutOfMemoryError: Cannot reserve 1048576 bytes of direct buffer memory (allocated: 134217728, limit: 134217728)
01:02:03  		at java.base/java.nio.Bits.reserveMemory(Bits.java:178)
01:02:03  		at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:120)
01:02:03  		at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:329)
01:02:03  		at DirectBufferAllocTest.lambda$main$0(DirectBufferAllocTest.java:126)
01:02:03  		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
01:02:03  		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
01:02:03  		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
01:02:03  		... 1 more

To Reproduce
https://ci.adoptopenjdk.net/job/Test_openjdk14_hs_sanity.openjdk_ppc64_aix/111/console

Expected behavior
We expect no OOMs.

Additional context
The test was explicitly created to elicit this kind of error, so the original bug that the test was created for could be useful.

Also, if the fix for this results in a 100% pass rate on openj9, close this issue when resolved

@smlambert
Copy link
Contributor

I do not see this failing in Hotspot builds: https://ci.adoptopenjdk.net/job/Test_openjdk15_hs_sanity.openjdk_ppc64_aix/77/testReport/java_nio_Buffer_DirectBufferAllocTest/

So, contrary to the comment in the OpenJ9 issue eclipse-openj9/openj9#4473 (comment), this is not a Hotspot issue.

This needs to be retested against OpenJ9, and if only failing there, we will close this issue as its tracked under OpenJ9 4473.

@smlambert
Copy link
Contributor

To be sure, I will grinderize it against hotspot, as I see its an intermittent failure at best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
aqa-tests
  
TODO
Development

No branches or pull requests

3 participants