Hi I have this error:

Fatal error: Out of memory (allocated 41156608) (tried to allocate 1210042 bytes) in .../includes/database.mysql-common.inc on line 41

The error comes out going to admin/build/modules

If I get rid of any module the error disappears. I have a 128MB of PHP memory limit and 51 modules in the sites/all/modules

Any idea?

Comments

phpdiva’s picture

Category: bug » support

From the first look, it doesn't seem like a bug. The modules page is pretty memory intensive. Is there any way you can increase the memory limit?

ainigma32’s picture

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

The ISP (Hostgator) said I hit the Apache memory limit, not the PHP one. Quite difficolt to manage this one. I don't know the code (yet) so ... any hope to optimize it?

ainigma32’s picture

Title: Fatal error: Out of memory (allocated 41156608) (tried to allocate 1210042 bytes) in .../includes/database.mysql-common.inc » Out of memory error on admin/build/modules
Status: Postponed (maintainer needs more info) » Closed (duplicate)

said I hit the Apache memory limit

Well the error you posted is really PHP running out of memory so I don't really understand what your ISP is talking about.

AFAIK there is no way of optimizing the admin/build/modules page other than disabling modules (but you figured that out yourself) or hacking core somehow.

There are some other issues active where people are trying to optimize that page and there is some (small) progress e.g. #311626: admin/build/modules very slow on some configurations and #304505: displaying admin/build/modules very slow

So it looks like you will have to wait for them to finish or join the effort.

Marking this as a duplicate of #311626: admin/build/modules very slow on some configurations

- Arie

watercooler43’s picture

We are having the same problem
Drupal Version 6.9
ISP (hostgator)
php.ini : memory_limit = 64M
Out of memory (allocated 46661632) (tried to allocate 2315438 bytes) in .../includes/database.mysql-common.inc on line 41

I have changed the php.ini memory_limit to 128M but same thing happens.
To reproduce:
Intall and Organic Groups modules,
In Admin | Organic Groups Configuration | [Edit a content type, eg. Blog] and change the description (or make any change) click save configuration
The error above is displayed.

PinoEire’s picture

I had this problem on Hostgator too. I moved to JustHost (they use php_SuExec which allows to use separate php configuration for each folder) and putting a PHP.INI in each folder (stating 64M as memory limit) the problem has been solved.
Cheers
Pino

NBery’s picture

Version: 6.8 » 6.10
foodin65’s picture

I'm also on HostGator and am getting the exact same issue. Has anyone found a solution for this. I can't do anything with my modules until this issue is resolved.

Error:

Fatal error: Out of memory (allocated 40894464) (tried to allocate 613552 bytes) in mysite.com/includes/database.mysql-common.inc on line 41

I don't even understand the error because the Tried to allocate is much smaller than the memory that is actually allocated.

This is what's on line 41 of that .inc file:
$query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);

Can this be resolved without switching hosts... that would be a royal pain. Everything else on my website function fine - I just can't get to the modules. Can anyone tell me how to disable module without having access to this page?

Set up: Latest versions of
Drupal 6.10
Ckk
Views,
User Relationships
Panels 3
Messages and Notifications

Thanks
Richard

dave147’s picture

I have the same problem with 1and1.com Drupal 6.10

Their PHP memory limit is 20M (even if the phpinfo() shows 40M says the support person)
as a result I can't access my modules page to remove some modules.
My question is: How do I remove some modules without this access.

Of course I can remove some module directories from my file system but won't this mess the installation?

Thanks
Dave

andreiashu’s picture

@dave147: you can go in phpMyAdmin or any other mysql gui and set the "status" column to 0 into the "system" table for the modules that you want to disable.

myers_d’s picture

There's a memory leak in preg_replace_callback(). I have a bit of code that imports thousands of records into my database. I was using db_query to process certain queries for me, but my script was bailing after a few hundred records. Once I removed db_query, it works great.

I found some discussion on the topic while searching the Googles. Seems there are ways around the bug that involve changed how you return values from your callback function. That's a fix which would need to be done to the Drupal core... or wait for a new version of PHP that fixes the issue.

richmck’s picture

I am running into this on Mosso (Rackspace Cloud) after 33MB -- I was able to increase it to 64M and was fine. IMHO -- this should be fixed to use less memory as I did not have that many modules in the database.

brianbrown’s picture

Bluehost which is hostgator as I understand it use, I believe, FASTCGI/PHP:
“FastCGI for PHP makes all your PHP applications run through mod_fastcgi instead of mod_phpsusexec. This eliminates the overhead of loading the PHP interpretor [sic] on every hit. Since it is always in memory ready for the next hit, the responses will be generated faster. NO MODIFICATIONS to your existing PHP applications will be performed so you can easily enable and disable it at will.”
Under cPanel, go to "Software/Services" and click on "PHP Configuration" then select "PHP5/FastCGI" then click "Save changes." You don't need to select "ION Cube" or "SourceGuardian" as they are optional.
Regards,
Brian
Fighting the New World Order... One click at a time!

Baker’s picture

Same problems for our site. Can manually enable/disable modules with phpMyAdmin, but the real question is why will all of the rest of the site including the module activated work perfectly fine, yet we get an out of memory error only on the modules administration page? It seems to me that some sort of work needs to be done to Drupal core to rectify this problem.

I'm a newbie though, so would someone please take a minute to explain why simply listing these modules becomes impossible when certain ones are activated? Why would they work and the rest of the site work and only the modules admin page generate an out of memory error?

Sincerely,
Baffled

Baker’s picture

THIS JUST IN:

It appears as though the module Fieldset Helper resolves my out of memory issues with regards to the modules administer page IF I fully collapse all of the individual sections and only have one section open at a time. Where before I would enable modules only to have that page break, now I can enable the very same module without that page breaking. Now I KNOW Drupal core needs some work, or at least it would seem to such a newbie as myself.

I would recommend writing the functionality of Fieldset Helper into core anyway as it improves the overall performance of Drupal AND solves a very real problem with the Administer>Modules page. Huge kudos to Jacob Rockowitz and Fieldset Helper for fixing this nasty little problem for us!

quietone’s picture

Version: 6.10 » 6.x-dev
Component: mysql database » ajax system
Issue summary: View changes
Issue tags: -error, -modules, -disable, -administer, -out of memory, -not enough, -breaks, -broken, -trouble, -troubleshoot, -fix, -enable