4 ms·
How is PHP's garbage collection for these kinds of things? Usually, it doesn't need to be that good as you can just release all the memory after a request is pr
by michh 14y ago
How is PHP's garbage collection for these kinds of things? Usually, it doesn't need to be that good as you can just release all the memory after a request is processed in the typical way PHP is used.
Anyone have experience running PHP-based daemons or things like that? If your React/NodePHP-application crashes on a 'Allowed memory size exhausted' every two days, it'll get old quick.
- rmccue 14y ago5.3 and 5.4 are a lot better, but I can't say I'd use them for long running daemons. Personally, I usually use Python daemons that spin up a PHP instance if they need.
- conradfr 14y agoGC is sure better in 5.3 as it was not available in 5.2 :)
- shakesbeard 14y agoWell, I think there was GC but no cyclic GC in pre-5.3.
- lux 14y agoAt least having more scripts like this could be helpful in improving PHP's memory management.
- dewiz 14y agoI created a server-less distributed network composed by PHP daemons some years ago, it was really fun seeing them linking, automatically discovering new nodes and distributing a task among the available nodes. We chose PHP because it was the only technology supported in the company, who didn't want to invest on consultancy, research, just do it now, you know. It was fun, but eventually PHP bad memory management became the main issue, so we were restarting daemons that would crash at random times, often in the middle of some tasks, other times while idle. Today, I would never create a new project like that using PHP, it doesn't make sense. PHP is great for templating, scripting, and there are some nice frameworks for the classic web applications. However each language has some limitations, an engineer should know much better than that.