clime
clime

Reputation: 8885

how to intrerpret output of tracefile-analyser.php run on xdebug trace file generated in Zend environment

My main goal is to determine memory requirements of my web application that runs under Zend. I have successfully setup xdebug, generated trace file with it and applied tracefile-analyser.php. Now, I need some help with interpreting the results. My question is if the memory that was needed by mysql is counted into that value? Is it really the total memory consumption per one request?

$ ./tracefile-analyser.php /var/www/simira/logs/profiles/trace.2043925204.xt memory-inclusive

parsing...                                                                                                                                                                                                                                                                                
(49.88%)                                                                                                                                                                                                                                                                                 

Done.                                                                                                                                                                                                                                                                                     

Showing the 25 most costly calls sorted by 'memory-inclusive'.                                                                                                                                                                                                                            

                                                                                    Inclusive        Own                                                                                                                                                                                  
function                                                                    #calls  time     memory  time     memory                                                                                                                                                                      
--------------------------------------------------------------------------------------------------------------------                                                                                                                                                                      
{main}                                                                           1  1.8332 19701712  0.0016   121392                                                                                                                                                                      
Zend_Loader_Autoloader::autoload                                                40  0.1397 12780440  0.0014   -11200                                                                                                                                                                      
Zend_Loader::loadFile                                                           23  0.0959 10480432  0.0311  3501384                                                                                                                                                                      
Zend_Loader::loadClass                                                          23  0.0980 10471760  0.0011   -12128                                                                                                                                                                      
call_user_func                                                                  49  0.1063 10471704  0.0004      664                                                                                                                                                                      
Zend_Loader_Autoloader->_autoload                                               23  0.0992 10470800  0.0005        0                                                                                                                                                                      
Zend_Controller_Front->dispatch                                                  1  1.3967 10284488  0.0022   390336                                                                                                                                                                      
Zend_Application->run                                                            1  1.3970 10284200  0.0000        0                                                                                                                                                                      
Zend_Application_Bootstrap_Bootstrap->run                                        1  1.3969 10284200  0.0001     -392                                                                                                                                                                      
Zend_Controller_Dispatcher_Standard->dispatch                                    1  1.1260  9144376  0.0001      896                                                                                                                                                                      
include_once                                                                    43  0.0786  7331968  0.0294  3679992   
...                                                                                                                                                  

Upvotes: 0

Views: 570

Answers (1)

Derick
Derick

Reputation: 36784

MySQL's memory usage, and I suppose you mean on the client side, and not the MySQL server side, is not included as it doesn't use PHP's memory management routines. Because of this, PHP (and henceforth Xdebug) can't show you that information.

As for your other question, yes, a trace gives the exact information for one request only. But be aware that when the script ends, some memory might already have been freed and thus doesn't show in up the memory for {main}. Simply use xdebug_peak_memory_usage() to find out the maximum amount of memory used.

Upvotes: 1

Related Questions