Skip to content

Commit 573fbcb

Browse files
Peter Wardnicolas-grekas
authored andcommitted
Add gc_mem_caches() call for PHP7 after itoken_get_all() as new memory manager will not release small buckets to OS automatically
1 parent 5bec94d commit 573fbcb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Kernel.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,12 @@ public static function stripComments($source)
733733

734734
$output .= $rawChunk;
735735

736+
if (PHP_VERSION_ID >= 70000) {
737+
// PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
738+
unset($tokens, $rawChunk);
739+
gc_mem_caches();
740+
}
741+
736742
return $output;
737743
}
738744

0 commit comments

Comments
 (0)