[php] memory_get_usage

Posted by topdog 144 days ago Questions| memory usage conns All

I'm making a little benchmark class to display page load time and memory usage. Load time is already working, but when I display the memory usage, it doesn't change Example:

$conns = array();
ob_start();
benchmark::start();
$conns[] = mysql_connect('localhost', 'root', '');
benchmark::stop();
ob_flush();

uses the same memory as

$conns = array();
ob_start();
benchmark::start();
for($i = 0; $i < 1000; $i++)
{
   $conns[] = mysql_connect('localhost', 'root', '');
}
benchmark::stop();
ob_flush();

I'm using memory_get_usage(true) to get the memory usage in bytes.

Discuss Bury


Who Voted for this Question