How to check & increase PHP memory usage

To check PHP menory usage

function display_used_memory()
{
    $m = memory_get_usage();
    $d = 1024 * 1024;
    echo number_format( $m / $d, 2 )."MB";
}

put display_used_memory() as the end of your PHP file.


To increase PHP memory usage

if( !ini_get( 'safe_mode' )) @set_time_limit( 3600 );

not every server supports this.

Topic

Discussion