ID: 35091
User updated by: paul at paulbutcher dot com
Reported By: paul at paulbutcher dot com
-Status: Bogus
+Status: Open
Bug Type: SOAP related
Operating System: *
PHP Version: 5.0.5
New Comment:
Sorry - I don't understand. Your example repeatedly appends to a
string, which of course will legitimately increase the size of the
string until it eventually fills memory.
I don't understand how this is the same as repeatedly allocating an
object. My example doesn't maintain a reference to the object, so
surely it should be garbage collected immediately?
In fact, if I replace SoapClient with an object of my own making then
memory usage remains constant:
<?php
class Foo {
private $bar;
public function __construct() { $bar = "Hi there!"; }
}
while(true) {
new Foo();
}
?>
What am I missing?
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2005-11-04 09:28:48] [EMAIL PROTECTED]
Ah, I should get glasses. You can also get all memory used with
something like this:
while (1) { $foo.= "bar"; }
Not bug but expected behaviour. Just don't do that!
------------------------------------------------------------------------
[2005-11-04 00:36:03] paul at paulbutcher dot com
Same result (on Windows - haven't tried it on Linux yet)
------------------------------------------------------------------------
[2005-11-03 21:42:36] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-11-03 19:52:18] paul at paulbutcher dot com
Description:
------------
SoapClient doesn't seem to clean up after itself when garbage
collected. It leaks something around 4K each time. Tested on both
Windows and Linux.
Reproduce code:
---------------
<?php
while(true) {
new SoapClient("test.wsdl");
}
?>
Expected result:
----------------
Assuming that I understand the PHP Garbage Collector (and it's possible
that I don't - I'm struggling to find any good documentation on exactly
how I should expect it to behave - any pointers very welcome!), I would
expect the memory usage of this script to be constant.
Actual result:
--------------
The memory usage increases very quickly (growing to several hundred
megabytes in less than a minute).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35091&edit=1