我正在用Netty-4 CR6的最新版本试用我的应用程序。在我的应用程序的服务器端,在大约200个请求/秒的负载下,我得到了以下错误:
io.netty.handler.codec.DecoderException: java.lang.OutOfMemoryError: Direct buffer memory
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:393)
at io.netty.handler.codec.ByteToMessageDecoder.messageReceived(ByteToMessageDecoder.java:129)
at io.netty.channel.DefaultChannelHandlerContext.invokeMessageReceived(DefaultChannelHandlerContext.java:379)
at io.netty.channel.DefaultChannelHandlerContext.fireMessageReceived(DefaultChannelHandlerContext.java:364)
at io.netty.channel.DefaultChannelHandlerContext.fireMessageReceived(DefaultChannelHandlerContext.java:347)
at io.netty.channel.DefaultChannelPipeline.fireMessageReceived(DefaultChannelPipeline.java:780)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:92)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
at io.netty.channel.nio.NioEventLoop.run(NioEventL它是一个文件传输应用程序。我在Netty-4 CR6 jar中使用客户机和服务器构建。在每个请求中,客户端创建一个WebSocket连接,传输一个大约850KB的文件,最后通过发送CloseWebSocketFrame关闭连接。
发布于 2013-06-28 21:24:44
看一下下面的bug。你可能会撞上它的。这里有几个选项
msgs.releaseAll()。io.netty.channel.SimpleChannelInboundHandler类作为使用处理程序。然后,您不需要使用releaseAll逻辑,因为它会在内部由netty照顾您。https://stackoverflow.com/questions/17320180
复制相似问题