My Symfony application is using a lot of memory for a reason I do not quite understand (I am not processing images or anything that I think would be heavy on memory).
I can see from here that 128M of memory limit is very high…and that no one should ever need that much memory.
php.ini file:
memory_limit = 128M;
I believe people have to deal with this too within a Symfony application, so I was wondering if I could have some input on the following:
- Is 128M manageable, or is this really amazingly high? What do people use in general within a Symfony app, and what is the maximum I should tend to go to?
- What can I do to improve this, is there a way to debug memory issues?
- Are there any processes that use a lot of memory that I should be aware of while coding?
(I for example noticed that injecting many services in a class via the DIC could require more memory, even if I can’t guarantee this, I am just raising the question whether or not there are some important things a coder should know to avoid using too much memory, like using the DIC with care for example..).
It is ok. Any framework takes some resources for itselfs. On the other hand (and is more important) it allow you to develop rapidly
As I’ve commented earlier: use profiler to find out memory usage. It is very, very powerfull tool.
Many of them. Dependency injection may require more memory, and it makes you to create more files. But it makes design much better. If you want to write unit tests there is no alternative.