{"action":"created","issue":{"url":"https://api.github.com/repos/http4s/blaze/issues/45","repository_url":"https://api.github.com/repos/http4s/blaze","labels_url":"https://api.github.com/repos/http4s/blaze/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/http4s/blaze/issues/45/comments","events_url":"https://api.github.com/repos/http4s/blaze/issues/45/events","html_url":"https://github.com/http4s/blaze/pull/45","id":179053031,"number":45,"title":"Do Not Merge: Work around the java Socket \"memory leak\"","user":{"login":"bryce-anderson","id":2948506,"avatar_url":"https://avatars.githubusercontent.com/u/2948506?v=3","gravatar_id":"","url":"https://api.github.com/users/bryce-anderson","html_url":"https://github.com/bryce-anderson","followers_url":"https://api.github.com/users/bryce-anderson/followers","following_url":"https://api.github.com/users/bryce-anderson/following{/other_user}","gists_url":"https://api.github.com/users/bryce-anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/bryce-anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryce-anderson/subscriptions","organizations_url":"https://api.github.com/users/bryce-anderson/orgs","repos_url":"https://api.github.com/users/bryce-anderson/repos","events_url":"https://api.github.com/users/bryce-anderson/events{/privacy}","received_events_url":"https://api.github.com/users/bryce-anderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-24T21:32:04Z","updated_at":"2016-09-25T20:10:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/http4s/blaze/pulls/45","html_url":"https://github.com/http4s/blaze/pull/45","diff_url":"https://github.com/http4s/blaze/pull/45.diff","patch_url":"https://github.com/http4s/blaze/pull/45.patch"},"body":"Problem\r\n\r\nThe java NIO implementation leaks direct memory because of the\r\nway that it caches temporary direct ByteBuffers. This can lead\r\nto OOM like errors.\r\n\r\nSolution\r\n\r\nEnsure that the scratch buffer is a direct ByteBuffer, and copy\r\nheap buffers into it before writing, essentially stepping around\r\nthe logic that the JDK uses to write heap buffers.\r\n\r\nDetails\r\n\r\n- Add additional allocation methods to BufferTools to be more\r\nexplicit.\r\n\r\n- Use direct ByteBuffers for the scratch buffers in in NIO1 and NIO2\r\nbecause they will most often be talking directly to the socket and\r\nwould necessitate a copy.\r\n\r\n- Make tools for copying and fast forwarding ByteBuffers\r\n\r\n- Fix the memory leak.\r\n\r\n- Be awesome."},"comment":{"url":"https://api.github.com/repos/http4s/blaze/issues/comments/249443606","html_url":"https://github.com/http4s/blaze/pull/45#issuecomment-249443606","issue_url":"https://api.github.com/repos/http4s/blaze/issues/45","id":249443606,"user":{"login":"bryce-anderson","id":2948506,"avatar_url":"https://avatars.githubusercontent.com/u/2948506?v=3","gravatar_id":"","url":"https://api.github.com/users/bryce-anderson","html_url":"https://github.com/bryce-anderson","followers_url":"https://api.github.com/users/bryce-anderson/followers","following_url":"https://api.github.com/users/bryce-anderson/following{/other_user}","gists_url":"https://api.github.com/users/bryce-anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/bryce-anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryce-anderson/subscriptions","organizations_url":"https://api.github.com/users/bryce-anderson/orgs","repos_url":"https://api.github.com/users/bryce-anderson/repos","events_url":"https://api.github.com/users/bryce-anderson/events{/privacy}","received_events_url":"https://api.github.com/users/bryce-anderson/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T20:10:08Z","updated_at":"2016-09-25T20:10:08Z","body":"Benchmark results:\r\n```\r\n         /ping                      /bigstring\r\nBefore   193750.96 (25.5 MB/sec)    1125.51 (121MB/sec)\r\nAfter    195989.97                  1127.73\r\n\r\nReq/sec. Separate Amazon m4.2xlarge instances for server and for load. wrk, 500 connections, 8 threads.\r\n```\r\nI don't think this change makes any significant performance difference.\r\n"}}
{"actor":{"display_login":"bryce-anderson"}}