note 47816 deleted from function.memory-get-usage by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:12:58 +0000 |
| Subject: | note 47816 deleted from function.memory-get-usage by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196899@lists.php.net to get a copy of this message | ||
Note Submitter: webNOSPAMsjwans at hotmail dot com
----
A quick and dirty Windows XP / 2003 wordaround:
<?php
function getMemUsage()
{
if (function_exists('memory_get_usage'))
{
return memory_get_usage();
}
else if ( strpos( strtolower($_SERVER["OS"]), 'windows') !== false)
{
// Windows workaround
$output = array();
exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST',
$output);
return substr($output[5], strpos($output[5], ':') + 1);
}
else
{
return '<b style="color: red;">no value</b>';
}
}
?>