Skip to content

Memory Leak in Symfony Mailer when sending many attachments of >5MB #51764

@asmafarhat2006

Description

@asmafarhat2006

Symfony version(s) affected

5.4.22

Description

Hi ,
I have encountered an issue where attaching several files each of size 5MB , sends Out Of Memory exception
Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\OutOfMemoryError: "Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 23079128 bytes)" at vendor/symfony/mime/RawMessage.php line 53 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\OutOfMemoryError(code: 0): Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 23079128 bytes) at vendor/symfony/mime/RawMessage.php:53)"} [

Is that a known issue. or am I missing something ?

I have already tried using attachPart, attach , but it produces the same results.

How to reproduce

Attach numerous Files from form to be sent in email each of size 5MB .

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions