Why does Drupal require so much memory?
Hi, I'm getting the following error on a site, "Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 1077617 bytes) in...sites/all/modules/views-5.x-1.6/ views_cache.inc on line 146" The site basically has a content type with many computed and other fields, but no images or large files etc. So I'm wondering why it requires so much memory. I presume it's something to do with caching? I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem. Is there another a way to fix this? Kind Regards, Graeme McKibbin ------------------------------------- Software & Web Developer -------------------------------------
On Wed, Apr 2, 2008 at 9:12 AM, Graeme McKibbin <gmckibbin@iburst.co.za> wrote:
Hi,I'm getting the following error on a site, "Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 1077617 bytes) in...sites/all/modules/views-5.x-1.6/views_cache.inc on line 146"
The site basically has a content type with many computed and other fields, but no images or large files etc. So I'm wondering why it requires so much memory. I presume it's something to do with caching?
I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem. Is there another a way to fix this?
Consider what modules do you really need. Remove those you don't. Gabor
Is there another a way to fix this?
Drupal 6 loads less code. Drupal 7 will load even less thanks to http://drupal.org/node/221964 . If you want to see this problem solved, please review it.
Graeme McKibbin wrote:
I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem.
As an aside, and I may be wrong here, but isn't the max packets allowed a MySQL setting? Changing that isn't going to affect how much memory PHP has available to it. I think the setting you're looking for is: 'memory_limit' in ye olde php.ini I know this doesn't answer your question, sorry about that, thought it was worth mentioning though. :) Kind Regards, Liam McDermott.
Quoting Liam McDermott <liam@intermedia-online.com>:
Graeme McKibbin wrote:
I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem.
As an aside, and I may be wrong here, but isn't the max packets allowed a MySQL setting? Changing that isn't going to affect how much memory PHP has available to it.
In my test of D-6 for production I hit the max packet issue for the form cache and the watchdog save. I have a gigantic large taxonomy and I can't edit the node because it runs out of memory trying to fill the list of available terms to select.
I think the setting you're looking for is: 'memory_limit' in ye olde php.ini I know this doesn't answer your question, sorry about that, thought it was worth mentioning though. :)
There isn't a setting large enough for me to edit the node. I'm also having an issue with the search function for authenticated users. You can search all you want unauthenticated which is about 99.9% of my users so I'm not pinched for finding the reason. I haven't been able to determine what the difference is with the time I've spent looking. Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On Wed, Apr 2, 2008 at 3:12 AM, Graeme McKibbin <gmckibbin@iburst.co.za> wrote:
Hi, I'm getting the following error on a site,"*Fatal error:* Allowed memory size of 20971520 bytes exhausted (tried to allocate 1077617 bytes) in...sites/all/modules/views-5.x-1.6/views_cache.inc on line 146"
The site basically has a content type with many computed and other fields, but no images or large files etc. So I'm wondering why it requires so much memory. I presume it's something to do with caching?
I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem. Is there another a way to fix this?
Graeme Drupal itself (core) does not use a lot of memory. When you start adding contrib modules, taxonomies and such, things are different. Normally, people fall victim to the open buffet syndrome. http://2bits.com/articles/server-indigestion-the-drupal-contributed-modules-... Here is a patch that would allow you to measure which module eats up memory so you can attack the problem where it is. http://2bits.com/articles/measuring-memory-consumption-by-drupal-bootstrap-a... Here is another case where a module was modified (for something else) but memory size was less after the change. http://2bits.com/articles/bottleneck-replacing-taxonomy-term-count-nodes-in-... Also, using an op-code cache should make memory consumption by code go down significantly. Try APC or xcache and see. If it is a data set size issue, that will not help much. When you think about it 32M is not much. Ubuntu server now comes with a default settings of 128M for PHP5. -- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting.
Graeme McKibbin wrote:
Hi, I'm getting the following error on a site, "*Fatal error:* Allowed memory size of 20971520 bytes exhausted (tried to allocate 1077617 bytes) in...sites/all/modules/views-5.x-1.6/views_cache.inc on line 146"
The site basically has a content type with many computed and other fields, but no images or large files etc. So I'm wondering why it requires so much memory. I presume it's something to do with caching?
I'd asked the host to increase the max packets allowed and they made it 20M, but that still doesn't work. So I've requested it to be increased to 32M. But I'm concerned that in the future, I'll run into the same problem. Is there another a way to fix this?
There's a bug in Views that causes it to cache too much data with taxonomy; there are also other modules that can really abuse the Views cache, which can cause it to load a ton of data. (vote_up_down is particularly heinous about it, but only because it uses a votingapi module API in a way that is incorrect). Views uses a fair bit of memory; it takes a bunch of data to adequately describe your database so that it can build queries.
participants (7)
-
Earl Miles -
Earnie Boyd -
Graeme McKibbin -
Gábor Hojtsy -
Karoly Negyesi -
Khalid Baheyeldin -
Liam McDermott