Skip to content
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

[Mime] Use streams instead of loading raw message generator into memory #57224

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

bytestream
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #51764
License MIT

Generators can only be used once and so the previous iteration of the code loaded the contents of the generator into memory. That results in OOM errors when sending large e-mails.

This PR changes the behaviour so that the generator contents are loaded into a php://temp stream. By default 2MB is stored in memory and the rest is written to temporary files to prevent OOM issues.

@carsonbot carsonbot added this to the 6.4 milestone May 29, 2024
@bytestream bytestream changed the title Use streams instead of loading raw message generator into memory [Mime] Use streams instead of loading raw message generator into memory May 29, 2024
@xabbuh xabbuh added the Mime label May 30, 2024
@fabpot
Copy link
Member

fabpot commented Jun 3, 2024

Thank you @bytestream.

@fabpot fabpot merged commit b358048 into symfony:6.4 Jun 3, 2024
7 of 9 checks passed
@xabbuh xabbuh mentioned this pull request Jun 3, 2024
@fabpot fabpot mentioned this pull request Jun 4, 2024
@bytestream bytestream deleted the fix-51764 branch June 7, 2024 14:50
This was referenced Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants