Recent Topics

php memory used in debug mode

Started by on May 15, 2012 – Contents updated: May 15, 2012

May 15, 2012 09:17    

A suggestion for the debug mode:
Could you display the php memory used to display the page ?
memory_get_usage()
memory_get_peak_usage()

May 15, 2012 09:54

In fact both function are already in _misc_funcs.php debug_info()

Code

// ================================ Memory Usage ================================^M
                foreach( array( // note: 8MB is default for memory_limit and is reported as 8388608 bytes^M
                        'memory_get_usage' => array( 'display' => 'Memory usage', 'high' => 8000000 ),^M
                        'memory_get_peak_usage' /* PHP 5.2 */ => array( 'display' => 'Memory peak usage', 'high' => 8000000 ) ) as $l_func => $l_var )^M

But memory usage is not displayed.
If I added it manually at the end of debug_info(), it's displayed.

Code

#slamp_120515_begin
echo "MEMORY </BR>\n" ;
echo "get usage real=false:     " . memory_get_usage(false) . "</BR>\n";
echo "get peak usage real=false:" . memory_get_peak_usage(false) . "</BR>\n" ;
echo "get usage real=true:      " . memory_get_usage(true) . "</BR>\n" ;
echo "get peak usage real=true: " . memory_get_peak_usage(true) . "</BR>\n" ;
#slamp_120515_begin
 
        if ( ! $clean )^M
        {^M
                echo '</div>';^M
        }^M
}^M

May 19, 2012 07:03

It works just fine in my test install.
Can you make a screenshot or PM me debug password from your blog?

May 21, 2012 21:13

yeah, I checked that. It's weird that you don't have that displayed.
I'll get to it later


Form is loading...

Run your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.