Skip to content

Add gc_mem_caches() call for PHP7 after HttpKernel::stripComments() #17384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we call gc_mem_caches() because of the usage of token_get_all()I'd we should move these lines to stripComments().

}

$cache->write($content, $container->getResources());
Expand Down