php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71990 ArrayObject memory leak
Submitted: 2016-04-08 15:55 UTC Modified: 2016-08-14 04:22 UTC
From: littlexiang521 at gmail dot com Assigned:
Status: No Feedback Package: SPL related
PHP Version: 5.5.34 OS: CentOS / OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
44 - 25 = ?
Subscribe to this entry?

 
 [2016-04-08 15:55 UTC] littlexiang521 at gmail dot com
Description:
------------
if some class extends ArrayObject, in some circular reference conditions gc failed to recycle it.

see codes below, if class B is a stdClass everything works fine

Test script:
---------------
https://0bin.net/paste/CvMSmhUeaKgaE1iU#eQLFPuTHJ56KeveFKaPWoTetXtq+qgeWw+uGDjVbhiU



Expected result:
----------------
memory usage keeps low

9175040
9175040
9175040
9175040
9175040
9175040
9175040
9175040
9175040
9175040
9175040
9175040

Actual result:
--------------
OOM...

121896960
122945536
124256256
125304832
126615552
127664128
128974848
130285568
131334144
132644864
133693440

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home/data/songxiang/haojing/htdocs/pages/test_mem.php on line 40

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-08 16:15 UTC] littlexiang521 at gmail dot com
It's works fine with php 7.0 latest
 [2016-08-06 04:16 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2016-08-06 04:16 UTC] kalle@php.net
Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Considering there is only 4 months left of PHP 5.5's active cycle, and with all the gc improvements made to php7, it is not very likely to get fixed. So please try again and confirm if it works with PHP7. thanks!
 [2016-08-14 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 22:01:32 2024 UTC