News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dave Marshall's Blog:
Log memory usage using declare and ticks in PHP
May 16, 2008 @ 12:05:37

Posted to his blog, Dave Marshall has a tip that uses declare and a trick or two to check out the memory usage of your scripts.

As far as I know, there isn't any memory footprint profiling in Xdebug, I think there was at some point but they removed it because it was a little flaky. I like to monitor the memory usage within my scripts, and I've found this simple snippet can help.

The script defines a log_memory function that pushes the memory and time information into a session value. The register_tick_function method is used to add log_memory to the handler and its called over and over from inside his for loop.

0 comments voice your opinion now!
log memory usage ticks registertickfunction method session


blog comments powered by Disqus

Similar Posts

Joe Devon's Blog: How to get your talk accepted, experiences on the advisory board of Semtech & Zend

DevShed: Using Introspective Methods with the DirectoryIterator Class in PHP 5

Christopher Jones' Blog: Guide to PHP and Ruby/Ruby on Rails Sessions at Oracle OpenWorld 2007

PHP-Coding-Practices.com: Composing Methods: Replace Temp With Query

Hannes Magnusson: Query logging and profiling in MongoDB


Community Events





Don't see your event here?
Let us know!


security podcast opinion tool community framework install laravel library version package voicesoftheelephpant symfony series interview language release update introduction composer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework