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

Slawek Lukasiewicz's Blog:
PHP application diagnostics - Memtrack
Nov 08, 2011 @ 18:08:37

Slawek Lukasiewicz has posted about a handy tool that can be used to track memory consumption and performance in your PHP application - memtrack.

Application profiling can help us determine bottlenecks and possible problems during development. But sometimes we also need to diagnose problems in production environment. Frequent performance problems are connected with functions and methods using too much memory.

The tool allows you to set up thresholds for memory consumption and, if the scripts exceeds it, add warnings to your log files. He includes the simple instructions to install it (via PECL) and enable it in your php.ini. Some sample code to create a memory overvload is included to test it out. Configuration options let you set the limits and define functions to ignore if you know for sure there's trouble spots.

tagged: memtrack extension diagnostic limit warning

Link:

Antony Dovgal's Blog:
locating memory hungry code with memtrack
Jan 28, 2009 @ 17:19:18

Sometimes finding that one spot in your code that's geting bloated and consuming at majority of your memory can be a bit difficult. Antony Dovgal has proposed one solution in a new post to his blog - the memtrack extension for from PECL.

We needed to locate where most of the memory is allocated in our scripts (as some of them became too memory hungry), so I've created memtrack extension. This extension helps us to see unusually big memory allocations in production code.

The extension logs memory usage information out to the standard error log file (however that'd defined on your system) and comes with a few configuration options. These let you control things like a "soft limit" at which to report the usage problems, the ability to ignore certain functions that you might know will cause a high load and and "vm_limit" setting that can help if your script is leaking memory at the end of its run.

tagged: memory leak memtrack pecl extension bloat problem

Link:


Trending Topics: