PHP Memory Usage
Posted: Tue Sep 14, 2010 6:39 am
Hi,
I have a question regarding php memory usage.
At the moment, I have a website that is reporting very high memory usages using the linux top command (over 25 meg per request !!!) and I need to identify why and what is the source of this problem.
To start trouble shooting, I ran the php command memory_get_peak_usage in my index page which reported 8.5 meg as the max.
The index page includes class files, does some processing and so on. Normal stuff you would expect.
My question is, does this value include the memory usage used by all class calls. So, if I have some a call to $customer->getTotalSpend() in the index page which totals the spend of the current customer, would the total memory usage shown include that used by this class or do I need to output the memory allocation in each class file/script/include.
Any help/tips to resolving this issue is much appreciated.
Cheers
Uncle Ben
I have a question regarding php memory usage.
At the moment, I have a website that is reporting very high memory usages using the linux top command (over 25 meg per request !!!) and I need to identify why and what is the source of this problem.
To start trouble shooting, I ran the php command memory_get_peak_usage in my index page which reported 8.5 meg as the max.
The index page includes class files, does some processing and so on. Normal stuff you would expect.
My question is, does this value include the memory usage used by all class calls. So, if I have some a call to $customer->getTotalSpend() in the index page which totals the spend of the current customer, would the total memory usage shown include that used by this class or do I need to output the memory allocation in each class file/script/include.
Any help/tips to resolving this issue is much appreciated.
Cheers
Uncle Ben