public function retrieveTotalMemoryUsage()
    {
        $base = $this->retrieve(0);
        $total = $last = 0;

        foreach ($this->retrieve() as $item) {
            $total += max(0, (($item[5]-$base[5]) - $last));
            $last = $item[5]-$base[5];
        }

        return $total;
    }
public function retrieveTotalMemoryUsage()
    {
        $base = $this->retrieve(0);
        $total = $last = 0;

        foreach ($this->retrieve() as $item) {
            $total += max(0, (($item[5]-$base[5]) - $last));
            $last = $item[5]-$base[5];
        }

        return $total;
    }
public function retrieveTotalMemoryUsage ( ) { $ base = $ this -> retrieve ( 0 ) ; $ total = $ last = 0 ; foreach ( $ this -> retrieve ( ) as $ item ) { $ total += max ( 0 , ( ( $ item [ 5 ] - $ base [ 5 ] ) - $ last ) ) ; $ last = $ item [ 5 ] - $ base [ 5 ] ; } return $ total ; }
Returns the total memory usage from all samples taken by comparing
each sample to the base memory sample.

@return integer
Memory usage in bytes.
Returns the total memory usage from all samples taken by comparing each sample to the base memory sample .