{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/3567","labels_url":"https://api.github.com/repos/netty/netty/issues/3567/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/3567/comments","events_url":"https://api.github.com/repos/netty/netty/issues/3567/events","html_url":"https://github.com/netty/netty/issues/3567","id":65828954,"number":3567,"title":"Excessively large cumulation ByteBuf in SslHandler","user":{"login":"dkartaschew","id":2052368,"avatar_url":"https://avatars.githubusercontent.com/u/2052368?v=3","gravatar_id":"","url":"https://api.github.com/users/dkartaschew","html_url":"https://github.com/dkartaschew","followers_url":"https://api.github.com/users/dkartaschew/followers","following_url":"https://api.github.com/users/dkartaschew/following{/other_user}","gists_url":"https://api.github.com/users/dkartaschew/gists{/gist_id}","starred_url":"https://api.github.com/users/dkartaschew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkartaschew/subscriptions","organizations_url":"https://api.github.com/users/dkartaschew/orgs","repos_url":"https://api.github.com/users/dkartaschew/repos","events_url":"https://api.github.com/users/dkartaschew/events{/privacy}","received_events_url":"https://api.github.com/users/dkartaschew/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/defect","name":"defect","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/111","html_url":"https://github.com/netty/netty/milestones/4.0.27.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/111/labels","id":999318,"number":111,"title":"4.0.27.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":57,"closed_issues":22,"state":"open","created_at":"2015-02-27T20:06:24Z","updated_at":"2015-04-02T03:57:39Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-04-02T03:37:56Z","updated_at":"2015-04-02T05:41:34Z","closed_at":null,"body":"Hi,\r\n\r\nUpon upgrading from netty 4.0.23 to netty 4.0.26, we've found that during large/fast data transfers via TLS 1.2, the \"cumulation\" ByteBuf in the SslHandler grows to over 1GB in direct buffer usage, leading to OOM errors. The growth of the \"cumulation\" ByteBuf does appear to correspond with the amount of data received.\r\n\r\nThis growth occurs only the receiving side, irrespective of which side initiated the connection.\r\n\r\nTesting with netty 4.0.23 and 4.0.24 shows the buffer never/rarely grows, but starting with 4.0.25 the growth is seen. We've tested with Oracle JRE 7u67 and 8u31 with the same result. \r\n\r\nThe channel pipeline setup is:\r\n```java\r\nChannelPipeline p = ch.pipeline();\r\nif(engine != null){\r\n  p.addLast(\"ssl\", new SslHandler(engine));\r\n}\r\np.addLast(\"frameDecoder\", new ProtobufVarint32FrameDecoder());\r\np.addLast(\"protobufDecoder\", new ProtobufDecoder(ApplicationProtos.getDefaultInstance()));\r\np.addLast(\"frameEncoder\", new ProtobufVarint32LengthFieldPrepender());\r\np.addLast(\"protobufEncoder\", new ProtobufEncoder());\r\np.addLast(\"handler\", handler);\r\n```\r\nThis may be related to bugs #3559 and #3447 , but ultimately unsure. Removing the SslHandler does improve things in our instance, but suspect that is due to the pipeline setup. \r\n\r\nIf there is any more information required, please let me know."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/88745467","html_url":"https://github.com/netty/netty/issues/3567#issuecomment-88745467","issue_url":"https://api.github.com/repos/netty/netty/issues/3567","id":88745467,"user":{"login":"trustin","id":173918,"avatar_url":"https://avatars.githubusercontent.com/u/173918?v=3","gravatar_id":"","url":"https://api.github.com/users/trustin","html_url":"https://github.com/trustin","followers_url":"https://api.github.com/users/trustin/followers","following_url":"https://api.github.com/users/trustin/following{/other_user}","gists_url":"https://api.github.com/users/trustin/gists{/gist_id}","starred_url":"https://api.github.com/users/trustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trustin/subscriptions","organizations_url":"https://api.github.com/users/trustin/orgs","repos_url":"https://api.github.com/users/trustin/repos","events_url":"https://api.github.com/users/trustin/events{/privacy}","received_events_url":"https://api.github.com/users/trustin/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T05:41:34Z","updated_at":"2015-04-02T05:41:34Z","body":"@dkartaschew Could you tell me which `SSLEngine` implementation you are using? (OpenSslEngine vs the one from JDK)"}}