M
M
Maxim2021-03-10 08:56:56
PHP
Maxim, 2021-03-10 08:56:56

How to get around a memory leak without changing the config?

I use symfony backing to receive a chain of letters from the mail, I write letters to the cache, when I receive a large chain of letters, a lack of memory begins, please tell me which way to dig, how to give all the letters without clogging the memory

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AntonSidorenko, 2021-03-17
@AntonSidorenko

If it's a Symfony messenger handler, use the --no-debug option when running from the console and set a limit on the number of messages per run, either by time or memory, and run it through supervisor.
If you use an entity manager in a loop in a handler, don't forget to periodically call clear() on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question