/ Published in: PHP
In order to optimize your scripts, you may definitely want to know how many amount of RAM they use on your server. This snippet will check memory and then print initial, final and peak usages.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* prints Initial: 361400 bytes */ // let's use up some memory for ($i = 0; $i < 100000; $i++) { } // let's remove half of the array for ($i = 0; $i < 100000; $i++) { } /* prints Final: 885912 bytes */ /* prints Peak: 13687072 bytes */
URL: http://net.tutsplus.com/tutorials/php/9-useful-php-functions-and-features-you-need-to-know/