The magical gc_disable()

So to implement, I will modify or add into my custom php.ini this code
Code:
zend.enable_gc = Off
Right?
 
yes... or add this to config.php:
PHP:
gc_disable();

I don't think places outside the Deferred system would benefit much from using it, unless of course you are loading more than 100k objects per request (which means you have a bigger problem)
I only tested it on normal actions... will check what happens while deferring...
 
  • Like
Reactions: rdn
Garbage Collection has its uses so I don't recommend blindly turning it off.
gc_disable only affects the garbage collector used to detect and dispose of circular references between objects.

For long lived objects which live for the entire request, it is worthless. And the current php implementation is in fact is actively harmful if you have lots of things allocated, because the threshold which triggers this GC isn't configurable or self-tuning.
 
gc_disable only affects the garbage collector used to detect and dispose of circular references between objects.

For long lived objects which live for the entire request, it is worthless. And the current php implementation is in fact is actively harmful if you have lots of things allocated, because the threshold which triggers this GC isn't configurable or self-tuning.
Which goes back to what I was saying: Deferred. I can see circular reference happening much more often than your typical page rendering. You shouldn't need to turn this off for normal web requests (and if you do, you probably need to review your code)
 
Top Bottom