Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/08/2006, 11:42
rimon
 
Fecha de Ingreso: abril-2006
Mensajes: 56
Antigüedad: 17 años, 11 meses
Puntos: 0
Hola, mira utilizo esta funcion:

Código PHP:
function memory_get_usage()
   {
       
// If we are running on Windows
       
if ( substrPHP_OS0) == '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..