{"action":"created","issue":{"url":"https://api.github.com/repos/mono/mono/issues/1992","labels_url":"https://api.github.com/repos/mono/mono/issues/1992/labels{/name}","comments_url":"https://api.github.com/repos/mono/mono/issues/1992/comments","events_url":"https://api.github.com/repos/mono/mono/issues/1992/events","html_url":"https://github.com/mono/mono/pull/1992","id":102119015,"number":1992,"title":"[ChunkStream] CPU and memory leak fix when writing and reading infinitely","user":{"login":"BogdanovKirill","id":13848267,"avatar_url":"https://avatars.githubusercontent.com/u/13848267?v=3","gravatar_id":"","url":"https://api.github.com/users/BogdanovKirill","html_url":"https://github.com/BogdanovKirill","followers_url":"https://api.github.com/users/BogdanovKirill/followers","following_url":"https://api.github.com/users/BogdanovKirill/following{/other_user}","gists_url":"https://api.github.com/users/BogdanovKirill/gists{/gist_id}","starred_url":"https://api.github.com/users/BogdanovKirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BogdanovKirill/subscriptions","organizations_url":"https://api.github.com/users/BogdanovKirill/orgs","repos_url":"https://api.github.com/users/BogdanovKirill/repos","events_url":"https://api.github.com/users/BogdanovKirill/events{/privacy}","received_events_url":"https://api.github.com/users/BogdanovKirill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-20T11:26:02Z","updated_at":"2015-08-20T11:26:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/1992","html_url":"https://github.com/mono/mono/pull/1992","diff_url":"https://github.com/mono/mono/pull/1992.diff","patch_url":"https://github.com/mono/mono/pull/1992.patch"},"body":"The problem is connected with \"chunks\" field in ChunkStream class. As you can see in \"ReadFromChunks\" method, the number of elements of this array continuously grows, because array's elements are not removed but just set to null. So, every subsequent call of this method will be slower than previous and will use additional memory more and more infinitely. Yes, we have \"ResetBuffer\" method than could clear \"chunks\" array, but nobody call it when the connection is infinite.\r\n\r\nThe typical case when we need infinite connection is getting video stream from web server through HttpWebRequest.\r\n\r\nIn our server application we are getting 100% CPU usage after 6 hours of work. Server application must work for months."},"comment":{"url":"https://api.github.com/repos/mono/mono/issues/comments/132980741","html_url":"https://github.com/mono/mono/pull/1992#issuecomment-132980741","issue_url":"https://api.github.com/repos/mono/mono/issues/1992","id":132980741,"user":{"login":"monojenkins","id":11610122,"avatar_url":"https://avatars.githubusercontent.com/u/11610122?v=3","gravatar_id":"","url":"https://api.github.com/users/monojenkins","html_url":"https://github.com/monojenkins","followers_url":"https://api.github.com/users/monojenkins/followers","following_url":"https://api.github.com/users/monojenkins/following{/other_user}","gists_url":"https://api.github.com/users/monojenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/monojenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monojenkins/subscriptions","organizations_url":"https://api.github.com/users/monojenkins/orgs","repos_url":"https://api.github.com/users/monojenkins/repos","events_url":"https://api.github.com/users/monojenkins/events{/privacy}","received_events_url":"https://api.github.com/users/monojenkins/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T11:26:04Z","updated_at":"2015-08-20T11:26:04Z","body":"Hello! I'm the build bot for the Mono project. I need approval from a Mono team member to build this pull request. A team member should reply with \"approve\" to approve a build of this pull request, \"whitelist\" to whitelist this and all future pull requests from this contributor, or \"build\" to explicitly request a build, even if one has already been done. Contributors can ignore this message."}}