protected static function _getMemory()
    {
        if (function_exists('memory_get_usage')) {
            return memory_get_usage();
        } else {
            $output = array();
            $pid    = getmypid();

            if (substr(PHP_OS, 0, 3) == 'WIN') {
                @exec('tasklist /FI "PID eq ' . $pid . '" /FO LIST', $output);
                if (!isset($output[5])) {
                    $output[5] = null;
                }
                return (int)substr($output[5], strpos($output[5], ':') + 1);
            } else {
                @exec("ps -o rss -p $pid", $output);
                return $output[1] * 1024;
            }
        }
    }
protected static function _getMemory()
    {
        if (function_exists('memory_get_usage')) {
            return memory_get_usage();
        } else {
            $output = array();
            $pid    = getmypid();

            if (substr(PHP_OS, 0, 3) == 'WIN') {
                @exec('tasklist /FI "PID eq ' . $pid . '" /FO LIST', $output);
                if (!isset($output[5])) {
                    $output[5] = null;
                }
                return (int)substr($output[5], strpos($output[5], ':') + 1);
            } else {
                @exec("ps -o rss -p $pid", $output);
                return $output[1] * 1024;
            }
        }
    }
protected static function _getMemory ( ) { if ( function_exists ( 'memory_get_usage' ) ) { return memory_get_usage ( ) ; } else { $ output = array ( ) ; $ pid = getmypid ( ) ; if ( substr ( PHP_OS , 0 , 3 ) == 'WIN' ) { @ exec ( 'tasklist /FI "PID eq ' . $ pid . '" /FO LIST' , $ output ) ; if ( ! isset ( $ output [ 5 ] ) ) { $ output [ 5 ] = null ; } return ( int ) substr ( $ output [ 5 ] , strpos ( $ output [ 5 ] , ':' ) + 1 ) ; } else { @ exec ( "ps -o rss -p $pid" , $ output ) ; return $ output [ 1 ] * 1024 ; } } }
Get current usage memory
@return int
Get current usage memory