-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of Memory issue when uploading large files #889
Comments
Note : To be able to test the memory pressure of .Net vs RestSharp 105.2.3, here is how we tested it as there is an unreleased bug fix when using the .AddFile:
|
Any update on this? I'm having exactly the same issue and it seems to me reasonable to expose AllowWriteStreamBuffering either in RestClient or RestRequest. As far as I know there is no workaround. My use case it to send in parallel 100MB files and if AllowWriteStreamBuffering is true it will throw out of memory exception very often. |
I encounter same issue and don't how to deal with |
is it solved yet ???? |
@AgentCoolDevil you want to help? Do a pull request. |
Is anyone still getting this error on the latest version? |
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.
What 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.
Something like this would be sufficient for our need:
var request = new RestRequest(Method.POST); request.AllowWriteStreamBuffering = false; request.Files.Add(new FileParameter // ...
The text was updated successfully, but these errors were encountered: