• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

The magical gc_disable()

Mr. Goodie2Shoes

Well-known member
#5
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...
 

Xon

Well-known member
#9
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.
 

tyteen4a03

Well-known member
#11
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)