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

XMemcached network layout exception: java.lang.OutOfMemoryError: Direct buffer memory #119

Open
sfxnmadu opened this issue Jun 10, 2020 · 1 comment

Comments

@sfxnmadu
Copy link

sfxnmadu commented Jun 10, 2020

Hello,
We use memcached v2.4.6, and are currently getting the below error:

09-06-2020 09:36:34,934 ERROR MemcachedHandler:128 - XMemcached network layout exception: java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:694)
at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:241)
at sun.nio.ch.IOUtil.read(IOUtil.java:195)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at com.google.code.yanf4j.nio.impl.NioTCPSession.readFromBuffer(NioTCPSession.java:190)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onRead(AbstractNioSession.java:184)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:324)
at com.google.code.yanf4j.nio.impl.SocketChannelController.dispatchReadEvent(SocketChannelController.java:54)
at com.google.code.yanf4j.nio.impl.NioController.onRead(NioController.java:150)
at com.google.code.yanf4j.nio.impl.Reactor.dispatchEvent(Reactor.java:310)
at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:177)

I reckon this might be similar to the issue in raised here, but I will appreciate specific insights on how to address this problem for this type of OOME - Direct buffer memory. And yes, we do use the xmemcached client as a singleton instance.

Thank you

@killme2008
Copy link
Owner

It seems that you may have too many connections ,every connection will keep an read direct buffer. You can increase the max direct buffer size or decrease the connection pool size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants