After editing a term in my main vocabulary, Drupal outputted the following error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 3407854 bytes) in /var/www/drupal/modules/xmlsitemap/xmlsitemap.module on line 487

Whatever happened, I was also logged out after this error. However, the edits I made to the term were saved.

Regards, -asb

Comments

vm’s picture

Troubleshooting FAQ's section of the documentation area:
Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)...
may help.

asb’s picture

Thanks,

sure is php.ini the first place to look. My current settings:

max_execution_time = 120     ; Maximum execution time of each script, in seconds
max_input_time = 180 ; Maximum amount of time each script may spend parsing req$
memory_limit = 64M      ; Maximum amount of memory a script may consume (16MB)

I simply don't want to increase memory_limit even higher, if possible.

Are there recommended settings for Drupal? What is sensible?
What values are other people using?

And yes, the error is reproducable. I assume, it is caused by a large vocabulary, but I couldn't find any suggestions about the size of a vocabulary, potential limitations of Drupal, etc.

Thanks & regards, -asb

vm’s picture

Are there recommended settings for Drupal? What is sensible?
What values are other people using?

Dependant on variables like how many contrib modules are in use & the like.

darren oh’s picture

Status: Active » Closed (fixed)

At the moment, site maps are generated from a PHP array. The more links you have, the more memory it requires. For now I would recommend turning off "Submit site map when updated" on the search engines tab. Your site map will then be generated only on cron runs, hopefully within the memory limits. If it still exceeds the memory limit, you will experience issue 201644.

darren oh’s picture

Status: Closed (fixed) » Active
darren oh’s picture

Status: Active » Closed (duplicate)
Rob T’s picture

Thanks for the tip, Darren. Turning off the "Submit site map when updated" worked well for me.

kbahey’s picture

Status: Closed (duplicate) » Active

A site with over 42,000 nodes is experiencing this issue, even with 100MB, and I don't want to increase this further.

Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 71 bytes) in .../sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 15

I am NOT getting the error in http://drupal.org/node/201644, hence reopening this one.

The site is already configured to Submit only on cron, but cron never completes. The only solution was to disable the xmlsitemap module.

Is there a way to generate the XML from a temporary file, instead of a memory array?

codepoet’s picture

Same issue with the 6.x-dev version. Subscribing.

asb’s picture

> The site is already configured to Submit only on cron, but cron never completes. The only solution was to disable the xmlsitemap module.

Same problem here, php memory limit set to 96M, xmlsitemap module (and others) had to be disabled. Data about a site's structure needs to go into core so it can be utilized through an API by modules like xmlsitemap, sitemap, sitemenu and others working with the same set of data but presenting it differently. Other modules have similar problems, and IMHO it makes absolutely no sense if several developers try to reinvent the wheel for different, but similar modules.

Please have a look at maintenance/generateSitemap.php in any MediaWIki installation [1] how this is handled on medium to large sized high traffic sites.

Thanks & greetings, -asb

[1] http://www.mediawiki.org/wiki/Manual:GenerateSitemap.php

kbahey’s picture

@asb

This should not be into core. Why? Because everyone wants to use it differently. Not all sites need it. Let core be lean, mean and clean.

A better option is to create a sitemap API which provides this functionality to modules that need it. Then modules can build on top of that. Something for Google, something for HTML sitemap page, something for menu navigation, ...etc.

If that API proves useful, it can then be considered for core, but can still be useful outside it (e.g. voting API, Userpoints API, ...etc.)

Now back to the original problem. Any ideas on how to reduce memory consumption by xmlsitemap?

pharma’s picture

We have same problem . Any luck on this issue ?

vacilando’s picture

Subscribing...

wbosman’s picture

Subscribing

mcarrera’s picture

Version: 5.x-1.x-dev » 5.x-1.6

subscribing

avpaderno’s picture

Version: 5.x-1.6 » 5.x-2.x-dev

I am changing the referring version to the one which gets the code fixed.

avpaderno’s picture

Component: xmlsitemap » Code
Status: Active » Postponed (maintainer needs more info)

@asb: Are you using some modules that change the cache used by Drupal to be kept in memory?
Is this the case for somebody else who has this issue?

avpaderno’s picture

Title: Fatal error: Allowed memory size of 67108864 bytes exhausted... » Allowed memory size exhausted
pkej’s picture

Title: Allowed memory size exhausted » Fatal error: Allowed memory size of 67108864 bytes exhausted...

I usually add ini_set( "memory_limit", "128M" ); in the settings.php file, a couple of places even to 256M.

Increase PHP memory limit is a must read.

pkej’s picture

Title: Fatal error: Allowed memory size of 67108864 bytes exhausted... » Allowed memory size exhausted

Someone changed the title while I was writing, so I change it back to what he wanted.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

manumhndas’s picture

Version: 5.x-2.x-dev » 7.x-2.0-alpha1

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in my page
I got this error when i installed cart module how can i overcome this error? plz send me a solution.

Anonymous’s picture

Version: 7.x-2.0-alpha1 » 5.x-2.x-dev

This is a closed issue for 5.x-2.x-dev and is more than 2 years old. Open a new issue or look for one that is already open for the version you're using.