Loading core/lib/Drupal/Core/Installer/InstallerKernel.php +14 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\Core\Installer; use Drupal\Core\DrupalKernel; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Extend DrupalKernel to handle force some kernel behaviors. Loading Loading @@ -83,4 +84,17 @@ public static function installationAttempted() { return isset($GLOBALS['install_state']) && empty($GLOBALS['install_state']['installation_finished']); } /** * {@inheritdoc} */ protected function attachSynthetic(ContainerInterface $container): void { parent::attachSynthetic($container); // Reset any existing container in order to avoid holding on to old object // references, otherwise memory usage grows exponentially with each rebuild // when multiple modules are being installed. // @todo Move this to the parent class after https://www.drupal.org/i/2066993 $this->container?->reset(); } } Loading
core/lib/Drupal/Core/Installer/InstallerKernel.php +14 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\Core\Installer; use Drupal\Core\DrupalKernel; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Extend DrupalKernel to handle force some kernel behaviors. Loading Loading @@ -83,4 +84,17 @@ public static function installationAttempted() { return isset($GLOBALS['install_state']) && empty($GLOBALS['install_state']['installation_finished']); } /** * {@inheritdoc} */ protected function attachSynthetic(ContainerInterface $container): void { parent::attachSynthetic($container); // Reset any existing container in order to avoid holding on to old object // references, otherwise memory usage grows exponentially with each rebuild // when multiple modules are being installed. // @todo Move this to the parent class after https://www.drupal.org/i/2066993 $this->container?->reset(); } }