Problem/Motivation

Opening this as a child of #2493035: Discover any memory limit issues we have.

When submitting the modules page (no xdebug or xhprof), I see 70M of memory usage. We've just set core's minimum memory limit to 64M after lots of discussion (See #2289201-66: [Meta] Make drupal install and run within reasonable php memory limits so we can reset the memory requirements to lower levels, so opening this as a critical bug.

Proposed resolution

The immediate worst offender I found was field_help(). This takes 800ms wall time on my machine, and 8mb of memory.

In ModuleListForm::buildRow() we check if the module has a hook_help() for the main help path - by executing hook_help() with that path. For field_help() this means listing every field type, widget and formatter - just to render a link. Needs an issue - we can probably move the actual listing to a dedicated route then link to it?

Other bad offenders:

views_theme() - loads lots of plugins. Not a new problem particularly - theme registry rebuilds have always been bad, but grrr. Worth an issue in case we can come up with something.

fileld_system_info_alter() 3.8M - should already have an issue.
filter_system_info_alter() 3M - should already have an issue.

Remaining tasks

Get the child issues RTBC and committed, then check the memory usage again.

User interface changes

Not here.

API changes

Not here.

Comments

catch’s picture

Issue summary: View changes
catch’s picture

Title: [meta] Submitting the modules page exceeds 64M with standard profile » [meta-5] Submitting the modules page exceeds 64M with standard profile
Wim Leers’s picture

larowlan’s picture

Is it worth making simpletest emit a peak memory usage header in the child site and then have the runner collect it and fail the test if it exceeds 64mb, or even a lower value to add a buffer? We do something similar on client projects as part of our CI against a fixed list of pages.

Wim Leers’s picture

#4: that sounds splendid and very clever.

catch’s picture

That sounds good to me too. We'll need an opt-out for things like the simpletest self-test which are known to take loads of memory and which we're not interested in keeping under very much.

larowlan’s picture

YesCT’s picture

I missed the issue where "We've just set core's minimum memory limit to 64M after lots of discussion, so opening this as a critical bug."
Where did we do that?

System requirements for Drupal can be found at http://drupal.org/requirements
and says "Drupal 8 core requirements are in flux, but setting to 128 MB should be enough. See issue. "

YesCT’s picture

Issue summary: View changes

ah, I see. updating the issue summary.

catch’s picture

Title: [meta-5] Submitting the modules page exceeds 64M with standard profile » [meta-8] Submitting the modules page exceeds 64M with standard profile
xjm’s picture

catch’s picture

Title: [meta-8] Submitting the modules page exceeds 64M with standard profile » [meta-9] Submitting the modules page exceeds 64M with standard profile
catch’s picture

Title: [meta-9] Submitting the modules page exceeds 64M with standard profile » [meta-10] Submitting the modules page exceeds 64M with standard profile
catch’s picture

Title: [meta-10] Submitting the modules page exceeds 64M with standard profile » [meta-8] Submitting the modules page exceeds 64M with standard profile

Re-tested after #2497017: Views::getApplicableViews() initializes displays during route rebuilding etc. (opcache disabled)

(to reproduce, install standard profile, enable actions module).

Tantalizingly close:
HEAD:
Submit: 65.73 MB
Form render: 52.96 MB

With #2392293: Refactor hook_system_info_alter implementations to use ModuleUninstallValidatorInterface applied:
Submit: 61.65 MB
Form render: 49.9 MB

That only just gets us under the memory limit, and #2495411: Make simpletest fail a test when it detects pages that need more than 64MB has flagged up we may have other pages with problems, but nice to see progress.

catch’s picture

Title: [meta-8] Submitting the modules page exceeds 64M with standard profile » [meta-6] Reduce cold cache memory requirements
Category: Bug report » Task
Priority: Critical » Major

Just lost my form submit to a d.o 504 timeout.

#2392293: Refactor hook_system_info_alter implementations to use ModuleUninstallValidatorInterface and #2494989: Don't render main help pages on modules page just to generate help links - can lead to high memory usage on form submit both committed today.

After those enabling actions module with no opcode cache is down to 59.4mb for the form submit, and 48mb for the subsequent page render.

Enabling all modules is still around 80mb, but

1. #1387438: Timeout on enabling modules: make it a batch operation is the issue to fix that, there's no reason not to do this in a batch.

2. For some reason, re-submitting the form succeeds - this might be the YAML file cache being primed by the first attempt, but I didn't look into it in depth. Either way it's a very different problem to a single module enable failing.

Given that, I'm going to downgrade this to major task. There are still some sub-issues here that are worth doing, but happy with 11mb saving here since opening the issue a couple of weeks ago.

catch’s picture

#1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID introduced quite a large performance regression on cache misses as far as I can tell.

Loading an entity requires getting all field definitions for the entity type - this can end up taking 3.5mb when installing a module for example.

That change was mainly for postgres so we might want to limit the casting to when postgres is in use.

catch’s picture

#19#18 isn't quite right. Getting the field definitions is expensive, but cleanIds() is just one of several places that gets them.

dawehner’s picture

#19 isn't quite right. Getting the field definitions is expensive, but cleanIds() is just one of several places that gets them.

A self-referencing comment, aaah!

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Status: Active » Closed (outdated)