php garbage collection mechanism

When assigning a value to a variable, PHP will allocate a zval to store the value, and there is no variable name in the zval structure.

After version 5.3, the garbage collection mechanism has been improved.
If it is found that the refcount in a zval container is increasing, it means that it is not garbage.
If it is found that the refcount in a zval container is decreasing, if it is reduced to 0, it is directly regarded as garbage collection
. The refcount is decreasing, but it has not decreased to 0. PHP will put the value in the buffer as a suspected object that may be garbage.
When the buffer reaches the critical value, PHP will automatically call a method to traverse each value. If it is found to be Clean up the rubbish

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324789751&siteId=291194637
Recommended