-
Notifications
You must be signed in to change notification settings - Fork 42
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
MultipartStreamBuilder uses too much memory when building the stream with a big body #96
Comments
Yeah. I know. Hm. |
Well, AFAIK, AppendSteam is a pure-PSR-7 stream wrapping other ones. And MultipartStream builds on top of it. In the meantime, I might investigate using |
Yeah. If you are developing an application you should consider a specific implementation.
AppendStream is using guzzle specific stuff. That is why I didn’t port it to a new package but created MultipartStreamBuilder.
//Tobias Nyholm
… On 5 Apr 2018, at 18:32, Christophe Coevoet ***@***.***> wrote:
Well, AFAIK, AppendSteam is a pure-PSR-7 stream wrapping other ones. And MultipartStream builds on top of it.
In the meantime, I might investigate using GuzzleHttp\Psr7\MultipartStream instead (as I'm using guzzlehttp/psr7 as PSR-7 implementation anyway
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
quick idea: detect whether the This would only involve moving the header preparation to the |
Currently, MultipartStreamBuilder builds the whole content of the stream as a string in memory, even when the original data was built using a Stream wrapping a resource to avoid loading the whole file in memory at this point.
As building a multipart stream only involves appending the different strings with some delimiters, it would be much better to implementing this in a streaming way.
GuzzleHttp\Psr7\AppendStream
might help here (which is whatGuzzleHttp\Psr7\MultipartStream
uses internally)The text was updated successfully, but these errors were encountered: