allowed memory size exhausted
Hello all, I've been working on this problem since two days without avail. I have a Drupal site that, for some reason or the other, tries to allocate more than 300 MB of memory on request calls to not only the index.php, but to files such as update.php. The server itself has three live sites and non of them is experiencing any problems. Also note that depending on which page I'm trying to access, I get a different stack trace. And as you can see below, none of them are passing through any custom modules... To get to the point, here's the error and the stack trace to update.php (one of possible backtraces with same problem), any hints or ideas are more than welcome. [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Stack trace: [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 1. {main}() /var/www/abc/index.php:0 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 2. drupal_not_found() /var/www/abc/index.php:24 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 3. theme() /var/www/abc/includes/common.inc:391 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 4. init_theme() /var/www/abc/includes/theme.inc:606 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 5. _init_theme() /var/www/abc/includes/theme.inc:59 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 6. _theme_load_registry() /var/www/abc/includes/theme.inc:179 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 7. _theme_save_registry() /var/www/abc/includes/theme.inc:226 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 8. cache_set() /var/www/abc/includes/theme.inc:235 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 9. db_query() /var/www/abc/includes/cache.inc:109 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 10. _db_query() /var/www/abc/includes/database.mysql-common.inc:42 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 11. trigger_error() /var/www/abc/includes/database.mysql.inc:136 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 12. drupal_error_handler() /var/www/abc/includes/common.inc:0 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 13. watchdog() /var/www/abc/includes/common.inc:663 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 14. module_invoke() /var/www/abc/includes/bootstrap.inc:966 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 15. call_user_func_array() /var/www/abc/includes/module.inc:462 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 16. dblog_watchdog() /var/www/abc/includes/module.inc:0 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 17. db_query() /var/www/abc/modules/dblog/dblog.module:147 [Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP 18. func_get_args() /var/www/abc/includes/database.mysql-common.inc:34 -- Ashraf Amayreh CEO | O-Minds Cell. 962 78 8099997 Tel. 962 6 5655150 Fax. 962 6 5675150 Skype: aamayreh www.o-minds.com web development | web design user experience | branding design Connect with us on Twitter http://twitter.com/ominds Connect with us on LinkedIn http://www.linkedin.com/in/aamayreh
[Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34
Did you really allowed 320M of memory for PHP scripts execution or I miscalculated?! This is howfully huge! What are you trying to do here that could consume something like 10 times the "normal" drupal memory consumption? Pierre.
To debug why your code is requesting this kind of memory you can try following steps. 1. First increase the memory in your ini for you can get rid of this memory allocation error, you can try to increase this to around 1 GB or something similar (depends how much memory you have on your machine)... If even increasing memory upto that HUGE level does not help you, then something is really really WRONG with your setup, which need to be looked upon within code for some loops or something like that. 2. If you are able to run your application by increasing Memory, please install APD on your server. see http://in.php.net/apd Use APD to track which functions are taking more memory to debug your application. Also check if problem is new on this server and application runs fine or other machine with different version of PHP, in some recent versions of PHP few functions behavior has been changed due to which few scripts or older module behave in unexpected way.. Thanks and Regards Zareef Ahmed On Fri, Jan 14, 2011 at 7:12 PM, Pierre Rineau < pierre.rineau@makina-corpus.com> wrote:
[Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34
Did you really allowed 320M of memory for PHP scripts execution or I miscalculated?!
This is howfully huge!
What are you trying to do here that could consume something like 10 times the "normal" drupal memory consumption?
Pierre.
-- Zareef Ahmed http://www.zareef.net
I believe you got the message .. as some sentence were not in flow due to my fast typing .. :) On Fri, Jan 14, 2011 at 6:39 PM, Zareef Ahmed <zareef@zareef.net> wrote:
To debug why your code is requesting this kind of memory you can try following steps.
1. First increase the memory in your ini SO you can get rid of this memory allocation error, you can try to increase this to around 1 GB or something similar (depends how much memory you have on your machine)... If even increasing memory upto that HUGE level does not help you, then something is really really WRONG with your setup, which need to be looked upon within code for some loops or something like that.
2. If you are able to run your application by increasing Memory, please install APD on your server. see http://in.php.net/apd Use APD to track which functions are taking more memory to debug your application.
Also check if problem is new on this server and application runs fine or other machine with different version of PHP, in some recent versions of PHP few functions behavior has been changed due to which few scripts or older module behave in unexpected way..
Thanks and Regards Zareef Ahmed
On Fri, Jan 14, 2011 at 7:12 PM, Pierre Rineau < pierre.rineau@makina-corpus.com> wrote:
[Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34
Did you really allowed 320M of memory for PHP scripts execution or I miscalculated?!
This is howfully huge!
What are you trying to do here that could consume something like 10 times the "normal" drupal memory consumption?
Pierre.
-- Zareef Ahmed http://www.zareef.net
-- Zareef Ahmed http://www.zareef.net
Just because the stack trace doesn't show the error going through custom modules doesn't mean that it's not a custom modules fault. An out of memory exception will be thrown the moment that a piece of code attempts to allocate an amount of memory which would put it over the memory limit. It does not mean that a piece of code is necessarily faulty. This means that module A could allocate 299 MB of memory, then when module B is called, it needs 1 MB, and the stack trace would show the call going via module B. As Zereef has said, if worst comes to worst, a memory profiler should help you diagnose the problem. - Frederik On 14 January 2011 13:14, Zareef Ahmed <zareef@zareef.net> wrote:
I believe you got the message .. as some sentence were not in flow due to my fast typing .. :)
On Fri, Jan 14, 2011 at 6:39 PM, Zareef Ahmed <zareef@zareef.net> wrote:
To debug why your code is requesting this kind of memory you can try following steps.
1. First increase the memory in your ini SO you can get rid of this memory allocation error, you can try to increase this to around 1 GB or something similar (depends how much memory you have on your machine)... If even increasing memory upto that HUGE level does not help you, then something is really really WRONG with your setup, which need to be looked upon within code for some loops or something like that.
2. If you are able to run your application by increasing Memory, please install APD on your server. see http://in.php.net/apd Use APD to track which functions are taking more memory to debug your application.
Also check if problem is new on this server and application runs fine or other machine with different version of PHP, in some recent versions of PHP few functions behavior has been changed due to which few scripts or older module behave in unexpected way..
Thanks and Regards Zareef Ahmed
On Fri, Jan 14, 2011 at 7:12 PM, Pierre Rineau < pierre.rineau@makina-corpus.com> wrote:
[Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34
Did you really allowed 320M of memory for PHP scripts execution or I miscalculated?!
This is howfully huge!
What are you trying to do here that could consume something like 10 times the "normal" drupal memory consumption?
Pierre.
-- Zareef Ahmed http://www.zareef.net
-- Zareef Ahmed http://www.zareef.net
Are you using the Firebug module? I've seen it use up all available memory. Just wondering if anyone else has seen it too. It does a lot of mysql select queries when I watch it through the debugger. -Don- On 1/14/2011 8:42 AM, Pierre Rineau wrote:
[Fri Jan 14 11:02:21 2011] [error] [client 1.2.3.4] PHP Fatal error: Allowed memory size of 335544320 bytes exhausted (tried to allocate 22175001 bytes) in /var/www/abc/includes/database.mysql-common.inc on line 34 Did you really allowed 320M of memory for PHP scripts execution or I miscalculated?!
This is howfully huge!
What are you trying to do here that could consume something like 10 times the "normal" drupal memory consumption?
Pierre.
participants (5)
-
Ashraf Amayreh -
Don -
Frederik Grunta -
Pierre Rineau -
Zareef Ahmed