Hint missing for Allowed memory size of x bytes exhausted

Created on 7 January 2025, 13 days ago

Problem/Motivation

Drupal's system requirements currently recommend a minimum of 64 MB of PHP memory to run Drupal.
A quick test of the new recipes in Drupal CMS showed that this size, as well as the default PHP value of 128 MB for memory_limit, is not enough to activate the recipe SEO tool without errors.
The reason for this is that more PHP memory is needed to activate the modules and configurations interwoven in the recipe.

I tested this this morning on

Ubuntu 20.04 LTS
Apache 2.4+
PHP8.3 FPM
and came to the conclusion that a default value of 256 MB is sufficient to install the recipe without errors.
Values smaller than the one given above currently cause Drupal to display an error message box without an error message when the recipe is activated, although the recipe is still shown as activated.

Steps to reproduce

Install Lamp stack given above using php8.3-fmp with a memory limit less then 256 MB eg 128 MB
Install drupal CMS
Go to Extend/Reccomended
Enable SEO Tools Recipe

You'll see a white box reserved for error messages without any error message
When you click the box away by using the X button the recipe is marked as activated

Proposed resolution

Please specify a minimum of 256 MB for the PHP memory limit in the minimum requirements for Drupal CMS. This does not solve the problem, but it completely hides it. Of course, I would prefer an appropriate error message at this point. The fact that Drupal runs out of resources when too many modules are activated at the same time is not a new problem since Drupal 6. However, we have obviously not yet found a way to issue a decent error message when a PHP script tries to consume more than the available memory. But since inexperienced users are likely to fall into this trap, we should at least point out in the documentation that Drupal CMS requires at least 256 MB in the PHP memory limit area.
Of course, the ideal solution would be to implement a corresponding message in the event of an error.

Remaining tasks

create patch or documentation note.

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Component

Track: SEO

Created by

πŸ‡©πŸ‡ͺGermany joachim namyslo Kulmbach πŸ‡©πŸ‡ͺ πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joachim namyslo
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    I am not sure that this is a Drupal CMS issue, but a Drupal issue as the steps to reproduce are on a specific stack, but the Drupal CMS tooling.

    However, I can be confident that this is not an SEO track issue.

    Moving it to the Infrastructure track, but assume this is a Drupal core issue.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Drupal CMS has a much bigger footprint than Drupal core, so it makes sense that we would recommend more RAM than the minimum suggested by core. That said, there's not much we can do to enforce this at a code level, but for documentation purposes, sure. Perhaps the installer can do a requirements-alter or something.

  • πŸ‡¬πŸ‡§United Kingdom catch

    I profiled the steps to reproduce with xhprof.

    Loading the 'recommended' page takes a long time, this looks like it might be package_manager related, didn't look into that yet.

    Installing the recipe, this is the xhprof summary:

    Total Incl. Wall Time (microsec):	14,518,042 microsecs
    Total Incl. MemUse (bytes):	167,312,128 bytes
    Total Incl. PeakMemUse (bytes):	167,674,928 bytes
    Number of Function Calls:	25,288,488
    

    I didn't see more than about 40-50mb of RAM usage on the previous Drupal CMS requests I profiled, including a full cache clear, so something is going on. Will open (probably core and project browser) issues and link from here if I get a bit further.

  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡¬πŸ‡§United Kingdom catch

    Just πŸ“Œ RecipeRunner::processInstall() installs modules one by one Active is responsible for so much extra work it's not worth profiling beyond it for the actual recipe install request. Once that's fixed, and maybe testing against 11.2 core too, it would be worth profiling again and seeing what's left. Right now installing the recipe is rebuilding the container ten times, rebuilding the router and menu links ten times, etc. etc.

    Opened πŸ› Drupal\project_browser\Element\ProjectBrowser::getDrupalSettings() is uncached Active for the 'recommended' page issue. That's one flag for Drupal settings is so expensive to build (several seconds) that it'll need to be profiled again once it's fixed, so also hard to untangle any other issues until that's fixed.

  • πŸ‡¬πŸ‡§United Kingdom catch

    I did some more testing with all the installer-recommended recipes installed, and didn't hit over 58mb requesting pages with a cold cache, which is within the recommendations that core sets. So for me personally, I would treat those two issues as critical bugs, and not change anything here - OOM is one of the single things that is hardest to workaround on shared/budget hosting, you can hit it with drush commands on pantheon for example (not really budget or shared).

Production build 0.71.5 2024