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

java.lang.OutOfMemoryError: Direct buffer memory after a certain time (approx. 1 week) #19

Open
pierrelucveilleux opened this issue Aug 11, 2016 · 1 comment

Comments

@pierrelucveilleux
Copy link

Did you experiment this error with your test?

Exception in thread "ActionDistributor: Thread-3" java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:658)
at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
at org.simpleframework.transport.SocketBufferAppender.(SocketBufferAppender.java:72)
at org.simpleframework.transport.SocketBuffer.(SocketBuffer.java:84)
at org.simpleframework.transport.SocketBufferWriter.(SocketBufferWriter.java:59)
at org.simpleframework.transport.SocketTransport.(SocketTransport.java:125)
at org.simpleframework.transport.OperationFactory.getInstance(OperationFactory.java:143)
at org.simpleframework.transport.OperationFactory.getInstance(OperationFactory.java:127)
at org.simpleframework.transport.TransportSocketProcessor.process(TransportSocketProcessor.java:145)
at org.simpleframework.http.core.ContainerSocketProcessor.process(ContainerSocketProcessor.java:143)
at org.simpleframework.transport.connect.SocketAcceptor.process(SocketAcceptor.java:297)
at org.simpleframework.transport.connect.SocketAcceptor.accept(SocketAcceptor.java:241)
at org.simpleframework.transport.connect.SocketAcceptor.run(SocketAcceptor.java:189)
at org.simpleframework.transport.reactor.ExecuteAction.run(ExecuteAction.java:72)
at org.simpleframework.common.thread.SynchronousExecutor.execute(SynchronousExecutor.java:41)
at org.simpleframework.transport.reactor.ActionDistributor.execute(ActionDistributor.java:734)
at org.simpleframework.transport.reactor.ActionDistributor.process(ActionDistributor.java:680)
at org.simpleframework.transport.reactor.ActionDistributor.process(ActionDistributor.java:653)
at org.simpleframework.transport.reactor.ActionDistributor.distribute(ActionDistributor.java:637)
at org.simpleframework.transport.reactor.ActionDistributor.execute(ActionDistributor.java:253)
at org.simpleframework.transport.reactor.ActionDistributor.run(ActionDistributor.java:233)
at org.simpleframework.common.thread.Daemon$RunnableDelegate.run(Daemon.java:156)
at java.lang.Thread.run(Thread.java:745)

@snapscript
Copy link

You can configure this, this occurs when the client is not reading quickly. It frees the writing thread and allows it to return to the servicing thread pool, allowing a sub-system to continue delivering the payload in the background. See the following to configure.

public TransportSocketProcessor(TransportProcessor processor, int threads, int buffer, int threshold) throws IOException { this(processor, threads, buffer, threshold, false); }

Here threshold represents the maximum size of the output buffer. You can reduce it to something like 1K which should resolve your memory issues.

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

1 participant