I recently had an issue with composer, while I was installing a symfony2 bundle.
The free memory on my VM was 700M
, but it wasn't enough. It only worked after I stopped some services and freed 1.2G
.
Composer documentation doesn't specify much about this:
Note: Composer internally increases the memory_limit to
512M
. If you have memory issues when using composer, please consider creating an issue ticket so we can look into it.
My question is - what does composer do internally that uses so much memory ?
In my mind, the process is fairly
simple, basically check dependencies between modules, then download module archives, and modify certain files. I presume the algorithms to negotiate a version of all the modules with X
stability aren't simple at all, but is this a common problem between package managers for other programming languages, or is it a composer optimization issue ? (I haven't heard of such problems with RubyGems, for example).
Memory in neural networks is required to store input data, weight parameters and activations as an input propagates through the network. In training, activations from a forward pass must be retained until they can be used to calculate the error gradients in the backwards pass.
Combining memory and processing resources in a single device has huge potential to increase the performance and efficiency of DNNs as well as others forms of machine learning systems.
The memory isn't needed for install, the solver has to analyze a lot of packages for an update. Adding a package usually picks the latest version, over time as new versions are released, the new packages are potential candidates.
Generally the looser the constraints, the more memory it takes to evaluate the potential candidates in between. Sorry, something went wrong. @sbuzonas Thanks, that's helpful.
Most other dependency managers don't have complete SAT solver and do "approximations" which require much less comparisons (so less cpu, less memory) but in some cases can yield invalid results or unsolvable things where package managers like bower will ask you what you want to do. The Composer solver usually finds a solution or conclusively finds a conflict.
So in short this is a design choice, but I realize this is also a problem due to the memory usage. There are a few strategies that should result in lower memory usage, but they are time-consuming things to even try and not many people have enough project-knowledge or time to make this happen, so it's kinda stalled at the moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With