diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 04ec2c240b480..fac8c66d89ac7 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -653,6 +653,10 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass, 'file' => (string) $cache)); if (!$this->debug) { $content = static::stripComments($content); + // reclaim memory for php7, as memory manager will not release after token_get_all() + if (function_exists('gc_mem_caches')) { + gc_mem_caches(); + } } $cache->write($content, $container->getResources());