{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/18219","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/18219/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/18219/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/18219/events","html_url":"https://github.com/dotnet/corefx/issues/18219","id":221070961,"number":18219,"title":"HttpContent.LimitArrayPoolWriteStream.Write causes a Grow on every call","user":{"login":"vitek-karas","id":10670590,"avatar_url":"https://avatars1.githubusercontent.com/u/10670590?v=3","gravatar_id":"","url":"https://api.github.com/users/vitek-karas","html_url":"https://github.com/vitek-karas","followers_url":"https://api.github.com/users/vitek-karas/followers","following_url":"https://api.github.com/users/vitek-karas/following{/other_user}","gists_url":"https://api.github.com/users/vitek-karas/gists{/gist_id}","starred_url":"https://api.github.com/users/vitek-karas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitek-karas/subscriptions","organizations_url":"https://api.github.com/users/vitek-karas/orgs","repos_url":"https://api.github.com/users/vitek-karas/repos","events_url":"https://api.github.com/users/vitek-karas/events{/privacy}","received_events_url":"https://api.github.com/users/vitek-karas/received_events","type":"User","site_admin":false},"labels":[{"id":497898703,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Net.Http","name":"area-System.Net.Http","color":"d4c5f9","default":false},{"id":145399955,"url":"https://api.github.com/repos/dotnet/corefx/labels/bug","name":"bug","color":"207de5","default":true},{"id":338307664,"url":"https://api.github.com/repos/dotnet/corefx/labels/os-windows-uwp","name":"os-windows-uwp","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/12","html_url":"https://github.com/dotnet/corefx/milestone/12","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/12/labels","id":2323293,"number":12,"title":"2.1.0","description":"Temporary version name - .NET Standard 2.0 for UWP release (post .NET Core 2.0.0)","creator":{"login":"karelz","id":5776068,"avatar_url":"https://avatars1.githubusercontent.com/u/5776068?v=3","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":95,"closed_issues":0,"state":"open","created_at":"2017-02-15T02:14:11Z","updated_at":"2017-04-11T20:31:52Z","due_on":"2017-07-15T07:00:00Z","closed_at":null},"comments":3,"created_at":"2017-04-11T20:28:02Z","updated_at":"2017-04-11T20:36:46Z","closed_at":null,"body":"The code in the Write is:\r\nEnsureCapacity(_buffer.Length + count);\r\n\r\nThe _buffer.Length is the size of the buffer, not the number of bytes written to it. So with this we're always asking for more than the buffer has room for, and thus we will call Grow. Grow is exponential (doubles the size of the buffer), so enough small writes into the stream will cause the Grow to ask for huge buffer and eventually run out of memory.\r\nThe correct code should be:\r\nEnsureCapacity(_length + count);"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/293392543","html_url":"https://github.com/dotnet/corefx/issues/18219#issuecomment-293392543","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/18219","id":293392543,"user":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars3.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"created_at":"2017-04-11T20:36:46Z","updated_at":"2017-04-11T20:36:46Z","body":">This breaks several applications in ProjectN.\r\n\r\nCan you explain in more detail about how this breaks several applications?  This code is also used for non-UWP stuff...so why aren't we seeing problems there?  What is different about this code in UWP that causes problems?"}}
{"actor":{"display_login":"davidsh"}}