Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey,
I seem to be getting a fatal memory size error on almost all the pages (frontpage, a node page. It seems to appear on all themes and in all diffrent kind of setups (diffrent sites with diffrent modules - the same error occurs). Maby it has something to do with the memory leaked posted as an issue : http://drupal.org/node/229386.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 281934 bytes) in /home/bojhan01/domains/bojhan.com/public_html/drupal6/modules/devel/devel.module on line 1299
Regards,
Bojhan
Comment | File | Size | Author |
---|---|---|---|
#13 | devel_recursion_fix.patch | 1.6 KB | jjeff |
#11 | devel-issue234581.patch | 777 bytes | Pedro Lozano |
Comments
Comment #1
DaimonteD CreditAttribution: DaimonteD commentedI'm getting a similar error, but only when Theme Developer is enabled:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1450427 bytes) in C:\xampp\htdocs\drupal\includes\common.inc on line 2275
Comment #2
astra CreditAttribution: astra commentedWith Drupal 6.1 and Devel 6.x-1.6 I also got a similar error
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 289592 bytes)
Web server Apache/1.3.41 (Unix) PHP/5.2.5
Comment #3
nickgs CreditAttribution: nickgs commentedI was simply trying to get the theme information for a view I am configuring and was experiencing this error. What I did to fix this problem is simply comment out all the code in the _devel_print_object function. Obviously this is NOT a solution but a little hack just keep my workflow going... :)
I spend a couple of minutes in thought about what can be going and I am not sold that it is in this function. Try simply doing a print_r on the first parameter in this function ($obj) with everything else commented out. This is generating the same memory error. It seems whatever is populating this array is going out of control. Making the recursive "magic" just impossible to complete.
Comment #4
Crell CreditAttribution: Crell commentedI am getting this as well. The problem is that the $output variable is being built as one ginormous value. On a page that has large data structures, such as a View, it is going to be an enormous amount of code that gets saved into that string, which is going to kill the memory limit as $output just gets ginormous. For me, that seems to be happening on every single View, because, well, View objects are big.
It also happens only when devel_themer is enabled, so I think that's the root cause. Refiling. I'm sure moshe will refile it back if I'm wrong. :-)
I think the solution has to be to break up $output and pull it in via AHAH calls as needed. Otherwise, the lookup data for it is just going to be too big.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedI'm not sure which $output we mean here. But anyway, how to AHAH this? This is information about the page render and is gone after the completes. There seems to be no benefit in persisting it.
Comment #6
Crell CreditAttribution: Crell commentedHrm. Good point. However, we do need to find some way to break it up. As is, it's a fatal memory leak on any site with Views. :-)
The code in question is _devel_print_object(). See line 1351 in the 1.7 release. That line serializes a data structure and builds up a large $output variable. That data structure is frequently a $views object, with all of its various child objects, with some recursion going on in there as well. That, for me, always ends up blowing the memory limit no matter how high I set it.
Do we actually need the entirety of all of those data structures? Could they be pruned? (I'm not actually sure what is happening in there, so I can't say. :-) )
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedAha. I actually don't use that code branch. If look at devel_themer_catch_function(), you see that if you have krumo, you use its code here. krumo is terrificaly useful for lots of devel stuff. Could folks install it and see if the errors go away. The README has instructions.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedAlso, devel_print_object() is the work of jjeff and a little dvessel. If it needs work, perhaps one of them can help.
Yes, we can and should prune some large variables from there I think.
Comment #9
ansorg CreditAttribution: ansorg commentedafter installing krumo I don't get the OOM error with views anymore. thanks for hinting to krumo as a workaround.
Comment #10
edward.peters CreditAttribution: edward.peters commentedI have had the same problem. Krumo is a bit beyond me as a non-developer (I need the Theme Developer module for theming) so I used the workaround in #3 and the memory errors disappeared.
Comment #11
Pedro Lozano CreditAttribution: Pedro Lozano commentedMaybe this fix the issues.
Comment #12
perandre CreditAttribution: perandre commentedI experienced the same issue with the white screen (of death...), so I just removed the devel-folder...not too clever. Now, I still get the white page, but no error in the php error log! And I can't access any page. What to do?
Update:
After a couple of server reboots, I get access to all pages. Before this, I tried to clean out devel-releated stuff in the db. Now, if I try to install the module again, I get all kinds of errors on my pages...exactly what can I do to remove all traces of the module, so that I can start fresh? (I can't uninstall it the proper way).
Comment #13
jjeff CreditAttribution: jjeff commentedThis patch limits recursion depth on the devel_print_object() function to 9 levels. Anything over that will output an error.
Please test this out and see if it fixes the problem.
Comment #14
perandre CreditAttribution: perandre commentedThanks for the patch!
I've never applied a patch before... When I tried, I got this error message:
...and my screen is still blank. That might not have been the case if I was able to apply the patch correctly, though.
Comment #15
moshe weitzman CreditAttribution: moshe weitzman commentedthis patch did not help in my quick testing ... i committed a change to just refuse to print out a Views object so thats our workaround for the moment. Help wanted .. .also remember that krumo users do not hit this troublesome function and still get full visibility into the Views object.
Comment #16
Pedro Lozano CreditAttribution: Pedro Lozano commentedwhich one of the 2 patches? did you also tried the one I submitted?
Comment #17
moshe weitzman CreditAttribution: moshe weitzman commentedI tried both, but only quickly. Perhaps someone else can verify that yours works or does not.
Comment #18
Steve Dondley CreditAttribution: Steve Dondley commentedpl2's patch in comment #11 got rid of the memory problem. I have not tested enough to know if it has any bad side effects.
Comment #19
coderintherye CreditAttribution: coderintherye commentedI was still experiencing the same error. I couldn't get into the Modules Administration to uninstall the devel module (just got white screen with lots of code) generating the error so I just deleted the folder for the devel module and that has seemed to fix the problem.
I haven't tried the patch, but I had just downloaded the latest 6.x beta from the Modules download section, so maybe this patch needs to be applied to what's available on the modules page? Sorry, not sure I'm fairly new to Drupal still.
Comment #20
moshe weitzman CreditAttribution: moshe weitzman commentedStill looking for proper fix, or confirmation of pl2's patch.
Comment #21
dergachev CreditAttribution: dergachev commentedHi guys, just got this error:
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 43 bytes) in /home/alex/projects/drupal/test1/sites/all/modules/devel/krumo/class.krumo.php on line 788
And upon disabling krumo, I get this error:
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 770827 bytes) in /home/alex/projects/drupal/test1/includes/common.inc on line 2275
However, disabling theme developer makes this go away. (I haven't applied any of the above patches)
Comment #22
moshe weitzman CreditAttribution: moshe weitzman commentedkrumo is now part of devel, so we avoid this error. please reopen as needed.
Comment #23
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #24
darumaki CreditAttribution: darumaki commentedI get this error in includes/theme.inc on line 57 and have no devl modules, I just sneezed and
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes)
there's plenty of memory size so not sure why it would do this.
Comment #25
dayre CreditAttribution: dayre commentedIn 6.2, this is the drupal_to_js function() which has recursive calls. I had a similar out of memory error due to recursion in an object graph that had the drupal_to_js function spinning to exhaustion. Check your object and try to eliminate circular references.
Comment #26
kenorb CreditAttribution: kenorb commentedLinks to other bugs related to '134217728 bytes exhausted' issue:
Watchdog - #167424: Cron jobs fail, all connected functionality (search, other modules) ceases to work
Content Access - #145523: Unable to rebuild permissions or install/uninstall module
IP to Country - #115027: Out of Memory on Install
Contemplate - #230885: CCK activates triggers Fatal error
Subscriptions - #211070: 1.x - Fatal error: Allowed memory size exhausted in subscriptions.module on line 878
Simplenews - #205798: "Fatal error: Allowed memory size of"...When I click on drupal/?q=admin/content/newsletters/settings
Content Management Filter - #324351: Pager not keeping accurate records on filter
FileField Paths - #325973: multiple upload
Node import - #235433: Out of Memory error when running any import #246746: loop error