Symfony 2 application memory limit

My Symfony application is using a lot of memory for a reason that I don't quite understand (I am not processing images or anything that I think would be memory heavy).


I can see from here that the 128M memory limit is very high ... and that no one should need that much memory.

Php.ini file:

 memory_limit = 128M; 

      


I believe people have to deal with this in a Symfony application too, so I was wondering if I could add a few words about the following:

  • Is 128M manageable or is it really surprisingly high? What do people use in general in a Symfony application, and what is the maximum I should aim for?
  • What can I do to improve this, is there a way to debug memory problems?
  • Are there any processes that use a lot of memory that I should be aware of when coding?

(For example, I noticed that injection of many services in a class via DIC can take more memory, even if I cannot guarantee it, I just raise the question if there are any important things that the coder should know in order not to use too much memory, e.g. using DIC, e.g. with care.).

+3


source to share


1 answer


  • This is normal. Any infrastructure takes some resources for itself. On the other hand (and more importantly) it allows for rapid development

  • As I said earlier: use a profiler to find out about memory usage. This is a very, very powerful tool.

  • Many of them. Dependency Injection can consume more memory and force you to create more files. But it makes the design so much better. If you want to write unit tests, there is no alternative.



+3


source







All Articles