News Feed
Sections

News Archive


Community Events






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


feed this:

Dave Marshall's Blog:
Log memory usage using declare and ticks in PHP
0 comments :: posted Friday May 16, 2008 @ 12:05:37
voice your opinion now!

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.

tagged with: log memory usage ticks registertickfunction method session



ajax book job PHP5 mysql developer framework code zendframework cakephp package PEAR security conference zend releases example database release application

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