Re: How to measure memory leakage/usage in PHP?
| From: | Frank Arensmeier | Date: | Thu, 06 Mar 2008 07:51:49 +0000 |
| Subject: | Re: How to measure memory leakage/usage in PHP? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271067@lists.php.net to get a copy of this message | ||
6 mar 2008 kl. 06.10 skrev Zareef Ahmed:
HI Chirs, On 3/6/08, Chris <dmagick@gmail.com> wrote:You should be able to do that with a so called tick function. From the manual: "A tick is an event that occurs for every N low-level statements executed by the parser within the declare block. The value for N is specified using ticks=N within the declare blocks's directive section." Have a look at the function 'register_tick_function'. Take the function that was suggested previously by Chris and make it a tick function. //frankZareef Ahmed wrote:I have done that check and I am sure that only my changes are taking time, but they are large in numbers, so I was looking something to pin point the exact change which is consuming more memory. Thanks for your suggestions, I will definitely use them.Hi Chris, Thanks for such quick response. quite good suggestion, but my application is using a framework and lots of includes and even autoloads of classes are being done, so using break point approach is not possible for me.Why not? It just means the files are spread out in different folders instead of one place. If you're using a framework, set up a new very simple environment and see how much memory that uses by itself (see http://www.php.net/memory_get_peak_usage). That'll at least tell you whether it's the framework using all the memory or your specific changes to it.
--Postgresql & php tutorials http://www.designmagick.com/--Zareef Ahmed http://www.zareef.net A PHP Developer in India