Answer the question
In order to leave comments, you need to log in
Why doesn't xprof display memory usage when passing XHPROF_FLAGS_MEMORY?
Used xprof on php 5.6 - worked mostly fine. We switched to php7 - there is no official support for PHP 7 from xhprof yet, so we used a third-party fork - https://andymarrel.eu/programming/xhprof-php-7 - connected, it works, but only displays "Total Incl. Wall Time" and " Number of Function Calls" - does not show memory usage. Tested in the console - without any add-ons:
<?php
function bar($x) {
if ($x > 0) {
bar($x - 1);
}
}
function foo() {
for ($idx = 0; $idx < 2; $idx++) {
bar($idx);
$x = strlen("abc");
}
}
// start profiling
xhprof_enable();
// run program
foo();
// stop profiler
$xhprof_data = xhprof_disable();
// display raw xhprof data for the profiler run
print_r($xhprof_data);
Array
(
[foo==>bar] => Array
(
[ct] => 2
[wt] => 23
)
[bar==>[email protected]] => Array
(
[ct] => 1
[wt] => 2
)
[main()==>foo] => Array
(
[ct] => 1
[wt] => 58
)
[main()==>xhprof_disable] => Array
(
[ct] => 1
[wt] => 0
)
[main()] => Array
(
[ct] => 1
[wt] => 71
)
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question