Bug #81027 [NEW]: WeakReference will cause memory leaks
From: gy dot dlcs at gmail dot com
Operating system: Linux
PHP version: 8.0.6
Package: Unknown/Other Function
Bug Type: Bug
Bug description:WeakReference will cause memory leaks
Description:
------------
Just like the test script, When you Uncomment the !$wr->get(); line,
You will see the memory leaks in a few seconds.
Test script:
---------------
<?php
ini_set('memory_limit', '16M');
while (true) {
$a = new stdClass();
$a->a = $a;
$wr = WeakReference::create($a);
unset($a);
// Uncomment next line, memory will not leak
// $wr->get();
// Uncomment next line, memory will leak
// !$wr->get();
}
Expected result:
----------------
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried
to allocate 20480 bytes) in test.php on line 9
--
Edit bug report at https://bugs.php.net/bug.php?id=81027&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81027&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81027&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81027&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81027&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81027&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81027&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81027&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81027&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81027&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81027&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81027&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81027&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81027&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81027&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81027&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81027&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81027&r=mysqlcfg
Thread (14 messages)
- gy dot dlcs at gmail dot com
- gy dot dlcs at gmail dot comBug #81027 [Com]: WeakReference will cause memory leaks
- cmb@php.netBug #81027 [Opn->Nab]: WeakReference will cause memory leaks
- nikic@php.netBug #81027 [Nab]: WeakReference will cause memory leaks
- gy dot dlcs at gmail dot comBug #81027 [Com]: WeakReference will cause memory leaks
- cmb@php.netBug #81027 [Nab->Fbk]: WeakReference will cause memory leaks
- gy dot dlcs at gmail dot comBug #81027 [Asn]: WeakReference will cause memory leaks
- krakjoe@php.netBug #81027 [Asn]: WeakReference will cause memory leaks
- cmb@php.netBug #81027 [Asn]: WeakReference will cause memory leaks
- gy dot dlcs at gmail dot comBug #81027 [Opn]: WeakReference will cause memory leaks
- dharman@php.netBug #81027 [Com]: WeakReference will cause memory leaks
- nikic@php.netBug #81027 [Opn]: WeakReference will cause memory leaks
- nikic@php.netBug #81027 [Opn->Ana]: WeakReference will cause memory leaks
- nikic@php.netBug #81027 [Ana]: WeakReference will cause memory leaks