Hola, mira utilizo esta funcion:
Código PHP:
function memory_get_usage()
{
// If we are running on Windows
if ( substr( PHP_OS, 0, 3 ) == 'WIN' ):
$output = array();
// Should check whether tasklist is available, but I'm lazy
exec( 'tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output );
// Filter non-numeric characters from output. Why not use substr & strpos?
// I'm running Windows XP Pro Dutch, and it's output does not match the
// English variant, as will all other translations. This is a more generic
// approach, and has a better chance of actually working
return preg_replace( '/[^0-9]/', '', $output[5] ) * 1024;
// Tasklist outputs memory usage in kilobytes, memory_get_usage in bytes.
// So we multiply by 1024 and in the process convert from string to integer.
else:
return false;
endif;
}
Luego la imprimo:
echo memory_get_usage();
Siempre me da "0" y yo pense que luego de insertar la funcion.. (como explica en el ejemplo..) mostraria la cantidad de bytes consumido y eso..