Decent memory profiling tool for php -


i've built auto mailer application using sendgrid official php library , smtp api(the auto mailer runs cron job on ubuntu server).

the memory limit on production server set 32m, , yet on 1 of first runs of application on production server got message

allowed memory size of 33554432 bytes exhausted, wast trying allocate 256478 bytes

which makes no sense @ since 256478 < 33554432, , yet suspect have memory leak somewhere.

according to post, php has memory leaks issue, when dealing reciprocal relationships between objects, using own wrapper class inorder make code more readable , structed, main mailservice class, , class per each task, implements interface, , returns specific data(headers, sub values, recipient list) per each email.

i'll start adding destructor interface , each class, in order reassure there no memory leaks, not sure solve issue, because according memory benchmark have performed, of execution time, , memory consumed mailtransport.php class of swiftmailer.

so question basically, how can reset memory usage of class per each iteration?, there built in, or should implement method such on own?.

any assistance appreciated.

small visualization:enter image description here

allowed memory size of 33554432 bytes exhausted, wast trying allocate 256478 bytes

means php trying allocate additional 256478 above , beyond has allocated during running of script, , additional request has pushed total memory used on 33554432 threshold.

earlier versions of php had memory problems when encountered cyclic references between objects, though has improved 5.4.... whether affected depend on version of php running, , whether classes contain such cyclic references


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -