[support] Memory error

Jamie Holly hovercrafter at earthlink.net
Mon Apr 22 00:21:46 UTC 2013


While PHP gives a "fatal error" for out of memory, it may not be so much 
an error, but rather a misconfiguration. PHP ships with a default INI file.

Something you may find interesting. The default php.ini file that is 
distributed with PHP for production use actually sets the memory limit 
to 128mb:

https://github.com/php/php-src/blob/PHP-5.2/php.ini-recommended#L307

This has been since PHP 5.2, over 6 years ago:

https://github.com/php/php-src/commit/3ffc1c8f4a1e4c1658f94038e009e226258a65a4

Before that it was only 8mb and numerous shared hosts didn't even allow 
you to adjust it. They do now because they realize that web apps have 
become far more complex as the web has evolved.

(NOTE: The 64mb limit many encounter is due to the fact that the 
developers of their OS felt that is all that is needed and set the limit 
in the php.ini file they distribute. Luckily this is easy to change 
through numerous methods.)

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net

On 4/21/2013 7:16 PM, Roger wrote:
> On 04/21/2013 10:00 PM, support-request at drupal.org wrote:
> >
> > I'm getting this error, and it doesn't make sense to me:
> >
> > Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 101 bytes) in/home/wap/public_html/includes/database/query.inc on line 1856
> >
> > Its trying to allocate only 101 bytes. I get similar errors when I try to enable a module. I have the site also running locally, and get no error. What I have to do is make all changes on my local site, then upload the database to my remote site. It's a pain.
> >
> > What should I look for to fix this?
> >
> > Bill
> >
> >
> Bill Thank you.
> I won't go into details, it's all in the list and on the LUV forum. I
> have been asking about this error message for weeks now and there are
> suggestions but no resolution.
> It seems to be caused by drupal demanding more memory than PHP allows.
> Which could mean that php is not flexible enough to cope with high demand.
> It sometimes can be resolved in /sites/default/settings.php by adding
> init_set('memory_limit','128M') but this will not stop the error
> permanently.
> I have seen faulty modules and number of modules blamed, etc. Basically
> it all comes down to either a PHP 5 update is faulty or Drupal, or some
> 3rd party required module is faulty.
> It may be resolved by making entries in php.ini and .htaccess but this
> also does not permanently fix a problem which should not exist.
> Roger
>



More information about the support mailing list