Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.4

Request #14296 Improve memory usage for large arrays w/objects
Submitted: 2008-07-06 03:29 UTC
From: mick Assigned:
Status: Bogus Package: Var_Dump (version 1.0.3)
PHP Version: 5.1.6 OS: Apache 2.0
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 16 - 8 = ?

 
 [2008-07-06 03:29 UTC] mick (Michael Heuberger)
Description: ------------ Var_dump cannot dump large arrays containing objects because the memory runs out during the preg_match_all() function. I have a solution for that: In my case, there are many variables in the 'ignore_list' parameter. These to-be-ignored parameters should be removed before calling preg_match_all()

Comments

 [2008-07-08 09:44 UTC] doconnor (Daniel O'Connor)
Hey Michael, I don't suppose you've got some small test cases? Or if you've tried newer PHP versions?
 [2008-07-08 09:53 UTC] mick (Michael Heuberger)
Hello Version 5.1.6 should be really very new and I am sorry, I have no test scenario ready. But I have somewhat like a recursive dependency between two objects, both having references to each other. This is causing the memory leak. In the ignore parameters I am using class names of these objects referencing to each one but this doesn't help because ignoring classes isn't done before calling var_dump(), that's the problem. Cheers Michael H.
 [2008-07-10 07:23 UTC] fredericpoeydomenge (Frederic Poeydomenge)
I agree with Daniel, version 5.1.6 was released on 24-Aug-2006, that is to say almost two years ago ! Anyway, could you please check Bug #3965 (Unable to dump big size Object) and go through proposed solutions to see if it can solve your problem. Regards
 [2008-07-10 07:27 UTC] fredericpoeydomenge (Frederic Poeydomenge)
I agree with Daniel, version 5.1.6 was released on 24-Aug-2006, that is to say almost two years ago ! Anyway, could you please check Bug #3965 (Unable to dump big size Object) and go through proposed solutions to see if it can solve your problem. Regards
 [2008-07-10 08:05 UTC] mick (Michael Heuberger)
Hello guys Thank you for your support. Well, the hosting provider will upgrade to PHP 5.2.3 :) About the bug #3965 , I did some research and used this pseudocode for the big variable $inputRegistry: // lots of processing echo 'A: ' . memory_get_usage(); ob_start(); var_dump($inputRegistry); $result = ob_get_contents(); ob_end_clean(); echo 'B: ' . memory_get_usage(); echo 'C: ' . strlen($result); echo 'D: ' . strlen(serialize($result)); exit; The output was: A: 9577400 B: 43640296 C: 34062894 D: 34062908 As you can see, $inputRegistry is a very big variable with lots of recursion inside. Hope I could help you to locate the problem. Thank you for your help!! M. Heuberger
 [2013-03-13 14:07 UTC] fredericpoeydomenge (Frederic Poeydomenge)
-Status: Open +Status: Bogus
Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. fixed