As far as I know, there isn't any memory footprint profiling in Xdebug, I think there was at some point but they removed it because it was a little flaky. I like to monitor the memory usage within my scripts, and I've found this simple snippet can help. I don't think it's entirely accurate, but it can help a little. Unfortunately, I don't think it works all that well on Windows, if at all. All good on Linux though.


function log_memory() {
    $_SESSION['memory'][] = array(
        'time'   => microtime(true),
        'memory' => memory_get_usage(),
    ); // or insert your logging code here

declare(ticks = 50); // log every 50 ticks (low level instructions)
$var = 'a';

for($i=0;$i<100;$i++) {
    $var .= 'a';