Bug #66172 [Asn]: Garbage collector won't collect circullar dependecy if SPL classes involved
| From: | colder@php.net | Date: | Wed, 27 Nov 2013 15:23:42 +0000 |
| Subject: | Bug #66172 [Asn]: Garbage collector won't collect circullar dependecy if SPL classes involved | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182965@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66172&edit=1
ID: 66172
Updated by: colder@php.net
Reported by: aleksey at roave dot com
Summary: Garbage collector won't collect circullar dependecy
if SPL classes involved
Status: Assigned
Type: Bug
Package: Scripting Engine problem
Operating System: Any
PHP Version: 5.5.6
Assigned To: colder
Block user comment: N
Private report: N
New Comment:
I have a patch here: https://github.com/colder/php-src/commit/abf152b260dbcc1da1eb850c9f10098b812c67d4
It indeed affects any internal class with hidden (not property-based) state that is not exposed via
get_gc, which includes most SPL classes.. This patch is only about SplHeaps/Priority Queues, I will
need more time to generalize.
Previous Comments:
------------------------------------------------------------------------
[2013-11-26 03:22:01] aleksey at roave dot com
Sorry, linked wrong test run
http://3v4l.org/21Tdf
------------------------------------------------------------------------
[2013-11-26 03:07:15] aleksey at roave dot com
Description:
------------
This affects all versions with gc, 5.3 to 5.5
Tried script on http://3v4l.org/KmGDj
I can't tell what happens internally, but it looks like garbage collector will not detect and
collect circular dependencies if there are SPL classes involved (i suspect other built-in classes
are affected too)
Test script:
---------------
https://gist.github.com/Xerkus/7562464/raw/f6d0ff3f1fbc24a3a3ca99ac974571748103ab51/test.php
Expected result:
----------------
Memory stays at about the same level
Actual result:
--------------
Used memory grows constantly
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66172&edit=1