JDK-6999915 : TEST_BUG: test/java/nio/channels/AsynchronousSocketChannel/Leaky.java failed intermittently (win)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-11-14
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b120Fixed
Related Reports
Relates :  
Description
TEST: java/nio/channels/AsynchronousSocketChannel/Leaky.java
JDK under test: (C:\temp\jprt\P1\T\102757~1.AB2\TESTPR~1\WINDOW~1.1-P)
java version "1.7.0-201011141027.ab23780.jdk"
Java(TM) SE Runtime Environment (build 1.7.0-201011141027.ab23780.jdk-jprtadm_2010_11_14_02_45-b00)
Java HotSpot(TM) Client VM (build 20.0-b02, mixed mode, sharing)


ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME:   0.062 seconds
messages:
command: build Leaky
reason: Named class compiled on demand
elapsed time (seconds): 0.062

ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME:   0.062 seconds
messages:
command: compile C:\temp\jprt\P1\T\102757.ab23780\source\test\java\nio\channels\AsynchronousSocketChannel\Leaky.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.062

ACTION: main -- Failed. Execution failed: `main' threw exception: java.util.concurrent.ExecutionException: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory
REASON: User specified action: run main/othervm -XX:+DisableExplicitGC -mx64m Leaky 
TIME:   4.735 seconds
messages:
command: main -XX:+DisableExplicitGC -mx64m Leaky
reason: User specified action: run main/othervm -XX:+DisableExplicitGC -mx64m Leaky 
elapsed time (seconds): 4.735
STDOUT:
STDERR:
java.util.concurrent.ExecutionException: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory
	at sun.nio.ch.PendingFuture.get(PendingFuture.java:185)
	at Leaky$Connection.finishRead(Leaky.java:75)
	at Leaky.main(Leaky.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:732)
Caused by: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.run(WindowsAsynchronousSocketChannelImpl.java:512)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	... 1 more
Caused by: java.lang.OutOfMemoryError: Direct buffer memory
	at java.nio.Bits.reserveMemory(Bits.java:658)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:122)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306)
	at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:174)
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.prepareBuffers(WindowsAsynchronousSocketChannelImpl.java:405)
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.run(WindowsAsynchronousSocketChannelImpl.java:481)
	... 4 more

JavaTest Message: Test threw exception: java.util.concurrent.ExecutionException: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.util.concurrent.ExecutionException: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory

TEST RESULT: Failed. Execution failed: `main' threw exception: java.util.concurrent.ExecutionException: java.io.IOException: java.lang.OutOfMemoryError: Direct buffer memory
--------------------------------------------------

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/jdk/rev/f88048284eb6
04-12-2010

EVALUATION The default thread pool is a cached thread pool and on these very fast JPRT machines it is possible for the thread pool to grow to more than 64 threads. Each thread that initiate an I/O operation in the test will have 1MB direct buffer in its cache, causing the test to fail if more than 64 threads are created.
14-11-2010