diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 793f405..228fa74 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -872,6 +872,8 @@ protected function initializeContainer() { $container_definition = $this->getCachedContainerDefinition(); } + gc_collect_cycles(); + gc_disable(); // If there is no container and no cached container definition, build a new // one from scratch. if (!isset($container) && !isset($container_definition)) { @@ -894,6 +896,7 @@ protected function initializeContainer() { $class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container'); $container = new $class($container_definition); } + gc_enable(); $this->attachSynthetic($container);