{"action":"created","issue":{"url":"https://api.github.com/repos/mrniko/netty-socketio/issues/195","labels_url":"https://api.github.com/repos/mrniko/netty-socketio/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/mrniko/netty-socketio/issues/195/comments","events_url":"https://api.github.com/repos/mrniko/netty-socketio/issues/195/events","html_url":"https://github.com/mrniko/netty-socketio/issues/195","id":54302857,"number":195,"title":"1.7.3 leak memory","user":{"login":"tselishev-semen","id":5156529,"avatar_url":"https://avatars.githubusercontent.com/u/5156529?v=3","gravatar_id":"","url":"https://api.github.com/users/tselishev-semen","html_url":"https://github.com/tselishev-semen","followers_url":"https://api.github.com/users/tselishev-semen/followers","following_url":"https://api.github.com/users/tselishev-semen/following{/other_user}","gists_url":"https://api.github.com/users/tselishev-semen/gists{/gist_id}","starred_url":"https://api.github.com/users/tselishev-semen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tselishev-semen/subscriptions","organizations_url":"https://api.github.com/users/tselishev-semen/orgs","repos_url":"https://api.github.com/users/tselishev-semen/repos","events_url":"https://api.github.com/users/tselishev-semen/events{/privacy}","received_events_url":"https://api.github.com/users/tselishev-semen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-01-14T09:52:44Z","updated_at":"2015-01-15T08:40:28Z","closed_at":null,"body":"Hi. I use a framework(1.7.3 version) already some time and I have accumulated a number of issues:).\r\n1. Memory leak when loading Blobs:\r\n<b>ServerSIde<b>\r\n```java\r\npublic class FileDTO {\r\n    private byte[] data;\r\n    public FileDTO(int id, byte[] data, String error, String key, String name, String sql) {\r\n        super();\r\n       ...\r\n        this.data = data;\r\n       ...\r\n    }\r\n    ...\r\n}\r\n\r\npublic class Launcher {\r\n  public static void main(String[] args) throws InterruptedException {\r\n...\r\n  Configuration config = new Configuration();\r\n        config.setHostname(\"192.168.0.34\");\r\n        config.setPort(3000);\r\n        config.setMaxFramePayloadLength(10000000);\r\n        config.setMaxHttpContentLength(10000000);\r\n        final SocketIOServer server = new SocketIOServer(config);\r\n\r\n....\r\n }\r\n....\r\n  server.addEventListener(\"fileUpload\", FileDTO.class, new DataListener<FileDTO>() {\r\n            Connection conn = new WebService();\r\n            @Override\r\n            public void onData(SocketIOClient client, FileDTO data, AckRequest ackRequest) {\r\n               //code for upload file\r\n            }\r\n        });\r\n}\r\n```\r\n<b>Client Side</b>\r\n```javascript\r\nsocket.emit('fileUpload', {\r\n  data: base64Data\r\n..\r\n})\r\n```\r\nProblem: when I upload a large file( ~150+kb ), the server generates an error\r\n```java\r\ntype: class com.corundumstudio.socketio.protocol.Event\r\ncom.fasterxml.jackson.core.JsonParseException: Unexpected end-of-input in VALUE_STRING\r\n at [Source: io.netty.buffer.ByteBufInputStream@25f5445b; line: 1, column: 129893]\r\n        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)\r\n        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:508)\r\n        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInvalidEOF(ParserMinimalBase.java:445)\r\n        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInvalidEOF(ParserMinimalBase.java:441)\r\n        at com.fasterxml.jackson.core.base.ParserBase.loadMoreGuaranteed(ParserBase.java:408)\r\n        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2184)\r\n        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString(UTF8StreamJsonParser.java:2165)\r\n        at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getText(UTF8StreamJsonParser.java:279)\r\n        at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:224)\r\n        at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeArray(JsonNodeDeserializer.java:262)\r\n        at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:64)\r\n        at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:14)\r\n        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3023)\r\n        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:1705)\r\n        at com.corundumstudio.socketio.protocol.JacksonJsonSupport$EventDeserializer.deserialize(JacksonJsonSupport.java:140)\r\n        at com.corundumstudio.socketio.protocol.JacksonJsonSupport$EventDeserializer.deserialize(JacksonJsonSupport.java:126)\r\n        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)\r\n        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2192)\r\n        at com.corundumstudio.socketio.protocol.JacksonJsonSupport.readValue(JacksonJsonSupport.java:223)\r\n        at com.corundumstudio.socketio.JsonSupportWrapper.readValue(JsonSupportWrapper.java:55)\r\n        at com.corundumstudio.socketio.protocol.PacketDecoder.decode(PacketDecoder.java:180)\r\n        at com.corundumstudio.socketio.protocol.PacketDecoder.decodePackets(PacketDecoder.java:118)\r\n        at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:65)\r\n        at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:36)\r\n        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)\r\n        at com.corundumstudio.socketio.transport.WebSocketTransport.channelRead(WebSocketTransport.java:92)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at com.corundumstudio.socketio.transport.PollingTransport.channelRead(PollingTransport.java:109)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at com.corundumstudio.socketio.handler.AuthorizeHandler.channelRead(AuthorizeHandler.java:115)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)\r\n        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)\r\n        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)\r\n        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)\r\n        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        at java.lang.Thread.run(Thread.java:745)\r\n[nioEventLoopGroup-3-8] ERROR com.corundumstudio.socketio.handler.InPacketHandler - Error during data processing. Client sessionId: 3b89da4b-d899-4399-9a32-2d93236b1ad3, data:\r\njava.lang.NullPointerException\r\n        at com.corundumstudio.socketio.protocol.PacketDecoder.decode(PacketDecoder.java:181)\r\n        at com.corundumstudio.socketio.protocol.PacketDecoder.decodePackets(PacketDecoder.java:118)\r\n        at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:65)\r\n        at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:36)\r\n        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:168)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)\r\n        at com.corundumstudio.socketio.transport.WebSocketTransport.channelRead(WebSocketTransport.java:92)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at com.corundumstudio.socketio.transport.PollingTransport.channelRead(PollingTransport.java:109)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at com.corundumstudio.socketio.handler.AuthorizeHandler.channelRead(AuthorizeHandler.java:115)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)\r\n        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)\r\n        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)\r\n        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)\r\n        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)\r\n        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)\r\n        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)\r\n        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)\r\n        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)\r\n        at java.lang.Thread.run(Thread.java:745)\r\n```\r\na) How can I fix this error?\r\nb) If several times to upload a large file (2mb) in different pages, server crashes:\r\n```java\r\n[nioEventLoopGroup-3-8] ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() \r\nwas not called before it's garbage-collected. \r\nEnable advanced leak reporting to find out where the leak occurred. \r\nTo enable advanced leak reporting, specify the JVM option \r\n'-Dio.netty.leakDetectionLevel=advanced' or call ResourceLeakDetector.setLevel()\r\n```\r\nHow can I avoid it?"},"comment":{"url":"https://api.github.com/repos/mrniko/netty-socketio/issues/comments/70055001","html_url":"https://github.com/mrniko/netty-socketio/issues/195#issuecomment-70055001","issue_url":"https://api.github.com/repos/mrniko/netty-socketio/issues/195","id":70055001,"user":{"login":"mrniko","id":1104661,"avatar_url":"https://avatars.githubusercontent.com/u/1104661?v=3","gravatar_id":"","url":"https://api.github.com/users/mrniko","html_url":"https://github.com/mrniko","followers_url":"https://api.github.com/users/mrniko/followers","following_url":"https://api.github.com/users/mrniko/following{/other_user}","gists_url":"https://api.github.com/users/mrniko/gists{/gist_id}","starred_url":"https://api.github.com/users/mrniko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrniko/subscriptions","organizations_url":"https://api.github.com/users/mrniko/orgs","repos_url":"https://api.github.com/users/mrniko/repos","events_url":"https://api.github.com/users/mrniko/events{/privacy}","received_events_url":"https://api.github.com/users/mrniko/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T08:40:28Z","updated_at":"2015-01-15T08:40:28Z","body":"so setTcpReceiveBufferSize=10000000 helps?\r\n"}}