If you use an autoloader for your classes, it may be useful to include this code at the beginning of the function:
function autoloader($class) { $memory = memory_get_usage (FALSE ); print ("Autoloading $class - memory is $memory<br>"); (autoloader code here) }
As my application develops, this gives me a general idea of ββthe memory that my script uses. I never optimize my application to the very end, so each class is loaded individually, which is definitely useful to find out how much memory is used to load each of them.
Hope this helps someone :)
source share