Description
I've spent many hours by looking for a memory leak I have in my server that uses PM. After some hard review, and this won't probably be something for you guys, I noticed that the slaves can easily be memory friendly, but not the master, as tons of memory is used and rarely released.
Said that, and after some tests, I realized that adding a manual gc_collect_cycles()
each time a request has been responsed, makes the work. This will be probably the fastest way to get over the problem, but not the nicest one, and because good code should never be related to external processes like CG, but ensure that the memory is released when is not longer needed, I think that we should take care of that (even if is not part of the project, but part of the project this one is built on top of).
After these lines, I'd like to know if this is a persistant problem.
Do you have localized the parts of the ReactPHP code we could have memory leaks?
Do you have any examples of how to fix this? It is for sure related to anonymous functions, but I didn't encountered yet the point.
Thanks so much!