{"action":"created","issue":{"url":"https://api.github.com/repos/restsharp/RestSharp/issues/889","repository_url":"https://api.github.com/repos/restsharp/RestSharp","labels_url":"https://api.github.com/repos/restsharp/RestSharp/issues/889/labels{/name}","comments_url":"https://api.github.com/repos/restsharp/RestSharp/issues/889/comments","events_url":"https://api.github.com/repos/restsharp/RestSharp/issues/889/events","html_url":"https://github.com/restsharp/RestSharp/issues/889","id":182885179,"number":889,"title":"Out of Memory issue when uploading large files","user":{"login":"instriker","id":1218469,"avatar_url":"https://avatars.githubusercontent.com/u/1218469?v=3","gravatar_id":"","url":"https://api.github.com/users/instriker","html_url":"https://github.com/instriker","followers_url":"https://api.github.com/users/instriker/followers","following_url":"https://api.github.com/users/instriker/following{/other_user}","gists_url":"https://api.github.com/users/instriker/gists{/gist_id}","starred_url":"https://api.github.com/users/instriker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instriker/subscriptions","organizations_url":"https://api.github.com/users/instriker/orgs","repos_url":"https://api.github.com/users/instriker/repos","events_url":"https://api.github.com/users/instriker/events{/privacy}","received_events_url":"https://api.github.com/users/instriker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-13T19:57:21Z","updated_at":"2016-10-24T15:21:04Z","closed_at":null,"body":"When we are uploading the large files with RestSharp, we randomly get some OutOfMemory issues. This happens because RestSharp is using HttpWebRequest behind the scene, and the default value for AllowWriteStreamBuffering is true. This mean that the whole file are loaded in memory when doing the query, in case there are some redirections to be able to replay it. But If we are uploading a 500 mb file, its an issue.\r\n\r\nWhat we would need is to be able to set the AllowWriteStreamBuffering to false, but there is no way right now to alter the AllowWriteStreamBuffering in the ConfigureWebRequest.\r\n\r\nSomething like this would be sufficient for our need:\r\n\r\n`var request = new RestRequest(Method.POST);\r\nrequest.AllowWriteStreamBuffering = false;\r\nrequest.Files.Add(new FileParameter // ...`\r\n"},"comment":{"url":"https://api.github.com/repos/restsharp/RestSharp/issues/comments/255771986","html_url":"https://github.com/restsharp/RestSharp/issues/889#issuecomment-255771986","issue_url":"https://api.github.com/repos/restsharp/RestSharp/issues/889","id":255771986,"user":{"login":"Ahmed-92","id":3706210,"avatar_url":"https://avatars.githubusercontent.com/u/3706210?v=3","gravatar_id":"","url":"https://api.github.com/users/Ahmed-92","html_url":"https://github.com/Ahmed-92","followers_url":"https://api.github.com/users/Ahmed-92/followers","following_url":"https://api.github.com/users/Ahmed-92/following{/other_user}","gists_url":"https://api.github.com/users/Ahmed-92/gists{/gist_id}","starred_url":"https://api.github.com/users/Ahmed-92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ahmed-92/subscriptions","organizations_url":"https://api.github.com/users/Ahmed-92/orgs","repos_url":"https://api.github.com/users/Ahmed-92/repos","events_url":"https://api.github.com/users/Ahmed-92/events{/privacy}","received_events_url":"https://api.github.com/users/Ahmed-92/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T15:21:04Z","updated_at":"2016-10-24T15:21:04Z","body":"the issue is not in the HttpWebRequest it is in RestSharp it self sence they copy the file into memory befor sending it , here is the [issue](https://github.com/restsharp/RestSharp/blob/e7c65df751427298cb59f5456bbf1f59967996be/RestSharp/RestRequest.cs#L149)  "}}
{"actor":{"display_login":"Ahmed-92"}}