Bug #80135 [Opn->Dup]: Memory leak - some data structure is not shrunk
| From: | nikic@php.net | Date: | Tue, 22 Sep 2020 18:21:17 +0000 |
| Subject: | Bug #80135 [Opn->Dup]: Memory leak - some data structure is not shrunk | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229149@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80135&edit=1
ID: 80135
Updated by: nikic@php.net
Reported by: mvorisek at mvorisek dot cz
Summary: Memory leak - some data structure is not shrunk
-Status: Open
+Status: Duplicate
Type: Bug
Package: Scripting Engine problem
Operating System: any
PHP Version: 7.4.10
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #33487.
Previous Comments:
------------------------------------------------------------------------
[2020-09-22 17:28:10] mvorisek at mvorisek dot cz
Description:
------------
see test script, there is some zval/GC data structure, that is currently not shrunk
this is an issue for workers that normally process small and large requests occasionally, as once
the data structure inside php engine is enlarged, it never goes back and memory per worker/process
stays allocated
Test script:
---------------
function createGraph($c) {
$objs = [];
for ($i = 0; $i < $c; $i++) {
$obj = new \stdClass();
$objs[] = $obj;
$obj->x = $objs[mt_rand(0, count($objs) - 1)];
}
}
for ($i = 0; $i < 5; $i++) {
createGraph(2 * 1000 * 1000);
gc_collect_cycles();
echo round(memory_get_usage() / (1024 * 1024), 3) . " MiB\n";
}
Expected result:
----------------
memory usage stays below 1 MiB
Actual result:
--------------
16.361 MiB
16.361 MiB
16.361 MiB
16.361 MiB
16.361 MiB
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80135&edit=1