$memory_before = memory_get_usage(); do_the_thing(); echo '<xmp>'. print_r( memory_get_usage() - $memory_before . ' bytes', true ) .'</xmp>';
$memory_before = memory_get_usage(); do_the_thing(); echo '<xmp>'. print_r( memory_get_usage() - $memory_before . ' bytes', true ) .'</xmp>';