Bug #79519 [Com]: Memory leak in PHP 7.4

From: Date: Wed, 15 Dec 2021 12:11:06 +0000
Subject: Bug #79519 [Com]: Memory leak in PHP 7.4
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238434@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79519&edit=1

 ID:                 79519
 Comment by:         brendt at stitcher dot io
 Reported by:        kieran at miami-nice dot co dot uk
 Summary:            Memory leak in PHP 7.4
 Status:             Closed
 Type:               Bug
 Package:            Performance problem
 Operating System:   Linux
 PHP Version:        7.4.5
 Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

@nikic It's probably the other cases that haven't been fixed

> but there are variations on this that still leak (e.g. if it's an anon class instead).

Is this something I should open a bug report for if you're already aware of the issue?


Previous Comments:
------------------------------------------------------------------------
[2021-12-09 19:54:25] nikic@php.net

@brendt: Is this still the same issue? The fact that a leak occurs when running tests doesn't
say a lot about what the root cause is.

PHP 8.1 fixes specifically the case where a file defining an anon function gets included many times,
but there are variations on this that still leak (e.g. if it's an anon class instead).

------------------------------------------------------------------------
[2021-12-09 12:20:14] brendt at stitcher dot io

I want to follow up on this one, since the issue doesn't seem to be resolved.

Tested on PHP 8.1.0 and PHPUnit 9.5.10; running a Laravel test suite of 1400 tests results in a
rather significant memory leak. Here's a screenshot of the memory consumption plotted in a
chart: https://user-images.githubusercontent.com/6905297/145394833-dc488206-238d-4164-86e4-e2ad8c824590.png

This is the issue related to Laravel discussing the problem: https://github.com/laravel/framework/issues/30736
And here's the phpunit issue: https://github.com/sebastianbergmann/phpunit/issues/3915

------------------------------------------------------------------------
[2021-06-09 13:01:12] nikic@php.net

In PHP 8.1, the memory leak for repeated included anonymous functions has been addressed by https://github.com/php/php-src/pull/5595 (or at
least, mostly addressed).

The GC with destructors issue has been addressed by https://github.com/php/php-src/pull/5581.

I believe that covers the issues raised here.

------------------------------------------------------------------------
[2020-09-22 21:27:39] nikic@php.net

Related To: Bug #80140

------------------------------------------------------------------------
[2020-08-10 20:30:00] nikic@php.net

I did some work on this in https://github.com/php/php-src/pull/5593 and https://github.com/php/php-src/pull/5595, but
unfortunately it's not easy to fix.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=79519


--
Edit this bug report at https://bugs.php.net/bug.php?id=79519&edit=1


Thread (25 messages)

« previous php.bugs (#238434) next »