Edit report at https://bugs.php.net/bug.php?id=79519&edit=1
ID: 79519
Updated by: nikic@php.net
Reported by: kieran at miami-nice dot co dot uk
Summary: Memory leak in PHP 7.4
Status: Open
Type: Bug
Package: Performance problem
Operating System: Linux
PHP Version: 7.4.5
Block user comment: N
Private report: N
New Comment:
Not seeing anything obvious based on these profiles. Without a reproducer, the only suggestion I can
make is to a) gather garbage collection statistics using gc_status() (maybe Blackfire already
collects them and I can't find it) and b) create a memory profile using "USE_ZEND_ALLOC=0
valgrind --tool=massif php vendor/bin/phpunit" followed by "ms_print massif.*" (this
will take a long time to run). This may or may not pinpoint the source of the leak.
Previous Comments:
------------------------------------------------------------------------
[2020-04-24 17:57:09] kieran at miami-nice dot co dot uk
Description:
------------
I'm running the same code through PHP Unit 8.5.2 on PHP 7.3 and PHP 7.4 and there's a huge
memory leak in 7.4. Several others have confirmed a similar issue in https://github.com/sebastianbergmann/phpunit/issues/3915
PHPUnit 8.5.2 - PHP 7.3.17 - Memory: 769.00 MB
PHPUnit 8.5.2 - PHP 7.4.5 - Memory: 3.89 GB
Both instances are running in slightly modified images of docker php. The same changes but based off
php:7.3-cli-stretch and php:7.4-cli respectively. I can provide full php.ini of both which shows
nothing special going on...
I have generated a blackfire profile to show the issue:
* PHP 7.3 - https://blackfire.io/profiles/6b973d98-014a-4dd2-8b13-f0cf5842221c/graph
* PHP 7.4 - https://blackfire.io/profiles/c80f648b-a778-4b3c-8acf-00a628e1630f/graph
Comparison of PHP 7.3 against 7.4 - https://blackfire.io/profiles/compare/a2dfa36c-3203-4599-959b-95d87143776a/graph
--
I do note that since first running the tests (poss. PHP 7.4.4 or earlier) it was returning 4.16 GB
and on 7.4.5 it's now 3.89 GB so the memory leak fixes in recent releases has helped some
what...
Test script:
---------------
Unfortunately I cannot provide access to the code. It's a large Laravel application.
I would be grateful if based on the memory profiles someone could point in the right direction to
help debug the issue.
Expected result:
----------------
n/a
Actual result:
--------------
n/a
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79519&edit=1