View Revisions: Issue #1506

Summary 0001506: Collect statistics about garbage collection
Revision 2017-12-30 16:23 by derick
Description The PHP garbage collection doesn't expose statistical information about number of runs, efficiency, memory cleared and exact locations of code where they are triggered.

I want to port the functionality of my garbage_stats extension (https://github.com/tideways/php_garbage_stats) into Xdebug to provide this functionality.

It works by setting an INI setting "xdebug.gc_stats_enable=1" or calling the function "xdebug_start_gcstats([$filename]);".

Output of this process is a file written to disk by using the xdebug.gc_stats_output_dir/name options for naming or the provided filename in the function.

Currently only a non machine readable, tabular format is provided with the following data points:

- number of objects/hashtables cleared during the garbage collection run.
- efficiency of the GC run, specifiying a percentage of all the checked objects that where actually cleared. shouljd be high, otherwise the gc run was a waste.
- duration: how long took the garbage collection?
- memory before/after and % in reduction
- function that the garbage collection was triggered during.
Revision 2017-12-30 16:15 by beberlei
Description The PHP garbage collection doesn't expose statistical information about number of runs, efficiency, memory cleared and exact locations of code where they are triggered.

I want to port the functionality of my garbage_stats extension (https://github.com/tideways/php_garbage_stats) into XDebug to provide this functionality.

It works by setting an INI setting "xdebug.gc_stats_enable=1" or calling the function "xdebug_start_gcstats([$filename]);".

Output of this process is a file written to disk by using the xdebug.gc_stats_output_dir/name options for naming or the provided filename in the function.

Currently only a non machine readable, tabular format is provided with the following data points:

- number of objects/hashtables cleared during the garbage collection run.
- efficiency of the GC run, specifiying a percentage of all the checked objects that where actually cleared. shouljd be high, otherwise the gc run was a waste.
- duration: how long took the garbage collection?
- memory before/after and % in reduction
- function that the garbage collection was triggered during.