Is there a way to track garbe collector activity in PHP?

I would like to know if there is a way with PHP5.3 to track the activity of the garbage collector, for example in Java with the command line -verbose:gc .

I try to know how often and when the collection occurs.

I am also interested in time spent with collections.

+4
source share
1 answer

It seems you can activate the benchmarking of garbage collectors , recompile PHP with the flag DGC_BENCH=1 . You will get the following statistics:

 GC Statistics ------------- Runs: 110 Collected: 2072204 Root buffer length: 0 Root buffer peak: 10000 Possible Remove from Marked Root Buffered buffer grey -------- -------- ----------- ------ ZVAL 7175487 1491291 1241690 3611871 ZOBJ 28506264 1527980 677581 1025731 

This is not a true mark, but the only thing I could find.

+2
source

Source: https://habr.com/ru/post/1394906/


All Articles