Skip to main content

6u14 b01: "java.lang.OutOfMemoryError: Direct buffer memory" with G1

2 replies [Last post]
peter_jodeleit
Offline
Joined: 2008-04-04
Points: 0

We are using java.nio for communication and have no caching of direct byte buffers. When testing build 1.6.0_14-ea-b01 with G1 we experienced very soon OutOfMemoryErrors:

java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:633)
at java.nio.DirectByteBuffer.(DirectByteBuffer.java:95)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at sun.nio.ch.IOUtil.write(IOUtil.java:134)
at sun.nio.ch.SocketChannelImpl.write0(SocketChannelImpl.java:365)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:388)
at de.espirit.firstspirit.server.io.GatheringWriteBuffer.write(GatheringWriteBuffer.java:34)
...

java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:633)
at java.nio.DirectByteBuffer.(DirectByteBuffer.java:95)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:57)
at sun.nio.ch.IOUtil.write(IOUtil.java:69)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
at de.espirit.firstspirit.server.io.DirectChannelIO.write(DirectChannelIO.java:31)
...

We still have to test without G1 to see if this is a regression in 6u14 b01 or a G1 issue...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
peter_jodeleit
Offline
Joined: 2008-04-04
Points: 0

After switching off G1 collector the OutOfMemoryError disappereared.

peter_jodeleit
Offline
Joined: 2008-04-04
Points: 0

See the bug report on sun website: http://bugs.sun.com/view_bug.do?bug_id=6812202