ID:               22055
 Comment by:       tom at scl dot co dot uk
 Reported By:      jparneodo at yahoo dot fr
 Status:           No Feedback
 Bug Type:         Scripting Engine problem
 Operating System: RedHat 7.2
 PHP Version:      4.3.1-dev
 New Comment:

Is anyone looking into this?



I've found any method of releasing the objects fails, no just using the
unset() function, if the object just go out of scope they aren't
released, for ezample, if you do something like



function MyFunc() {

    $x = new C;

    $y = new C;

 

    $x->ref =& $y;

    $y->ref =& $x;

}



Then after the function has finished then the memory allocated for the
local variables $x and $y is not freed up.


Previous Comments:
------------------------------------------------------------------------

[2004-02-23 11:21:41] tom at scl dot co dot uk

I had this problem with PHP4.3.3. I then found this bug report and
upgraded to PHP5.0.0b4 to try and fix this problem and I still get the
memory leak problem, there is some demo code below, you need to change
/path/to/large/file. I've been using a file which is about 1.5mb and
when PHP is set to stop when it reaches 8mb then it only makes it
through the loop twice.



I'm 1.5 years into a project and I could really do with knowing if this
is going to be fixed anytime soon so I can either wait for the fix or
try and find a work around. Thanks for your time,

Tom



---



<?php

class C {

    var $ref;

    var $val;

 

    function C() {

        $this->val = file('/path/to/large/file');

    }

}

 

while (1) {

    $x = new C;

    $y = new C;

 

    $x->ref =& $y;

    $y->ref =& $x;

 

    unset($y);

    unset($x);

 

    echo ".";

}

?>

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

[2003-02-25 02:03:00] [EMAIL PROTECTED]

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 "Open". Thank you.



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

[2003-02-17 04:51:30] [EMAIL PROTECTED]

Test with the php5 snapshot please:



  http://snaps.php.net/php5-latest.tar.gz



It won't be fixed in PHP 4 anyway as it has to do with the way objects
work there.

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

[2003-02-16 15:40:55] adey dot spam at bigfoot dot com

I am experiencing this problem with Win2k/IIS 5.0.



Memory usage increases until the server starts to page and crawl to a
slow death.



I have helped this somewhat by writing an app to unload the ISAPI every
half an hour, but it is still causing problems about once a week (on a
very busy site).



Still preferable to using the CGI though....

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

[2003-02-06 08:56:47] jparneodo at yahoo dot fr

You are asking me to test PHP 5,

but the bug is open for for PHP 4

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

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
    http://bugs.php.net/22055

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

Reply via email to