ID: 35893
Updated by: [EMAIL PROTECTED]
Reported By: erik at phpcastle dot com
-Status: Open
+Status: Bogus
Bug Type: IMAP related
Operating System: Debian
PHP Version: 5.1.1
Assigned To: iliaa
New Comment:
Putting the code into the function would not force the freeing of
memory in this case. Unless you explicitly free it yourself you'll need
to wait till the script termination time.
By defention a leak in PHP would be a situation where at the end of the
script's execution memory allocated for the purpose of running the
script was not freed.
Previous Comments:
------------------------------------------------------------------------
[2006-01-10 14:36:11] erik at phpcastle dot com
Well.... I've tested in another way by putting imap_fetch_overview in a
function. When the function ends the memory should be free right?
Not in this case.
<?php
echo "Memory usage: " . memory_get_usage() . "\t- Before
fetch_overview function\n";
testclear ($stream);
echo "Memory usage: " . memory_get_usage() . "\t- After fetch_overview
function\n\n";
function testclear($stream) {
$imapOverview = imap_fetch_overview($stream, "1:*");
}
?>
My result is still the same:
Memory usage: 50264 - Before fetch_overview function
Memory usage: 89936 - After fetch_overview function
Memory usage: 89800 - Before fetch_overview function
Memory usage: 94608 - After fetch_overview function
Memory usage: 94472 - Before fetch_overview function
Memory usage: 97232 - After fetch_overview function
Memory usage: 97096 - Before fetch_overview function
Memory usage: 97232 - After fetch_overview function
I had also unset each object from the result array and it did not help
anything
------------------------------------------------------------------------
[2006-01-08 19:45:24] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
There is no bug here, the return value of imap_fetch_overview() is a
complex array that contains objects within it. If you trully want to
"free" it you need to itterate through the array freeing each element
individually.
------------------------------------------------------------------------
[2006-01-05 21:31:53] [EMAIL PROTECTED]
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-01-05 01:39:25] erik at phpcastle dot com
I've tried also with php 5.1.1 for debian and didn't help either :)
------------------------------------------------------------------------
[2006-01-04 14:30:16] erik at phpcastle dot com
Description:
------------
Fist of all I use version 5.0.4-1
When opening an imap connection and then performing an
imap_fetch_overview the memory usage is increasing every time I call
imap_fetch_overview.
Reproduce code:
---------------
http://phpcastle.com/memusage_test.phps
Actual result:
--------------
-------Start-------
Memory usage: 62488 - Next: Open connection
Memory usage: 62544 - Next: Imap check
Memory usage: 62968 - Next: Clear $mailboxinfo
Memory usage: 62968 - Next: Fetch Overview
----------Num msg: 10-----
Memory usage: 74448 - Next: Clear Overview
Memory usage: 74448 - Next: Close connection
Memory usage: 74448 - Next: Clear imap stream
Memory usage: 74448 - Next: Open connection
Memory usage: 74448 - Next: Imap check
Memory usage: 74448 - Next: Clear $mailboxinfo
Memory usage: 74448 - Next: Fetch Overview
----------Num msg: 10-----
Memory usage: 75152 - Next: Clear Overview
Memory usage: 75152 - Next: Close connection
Memory usage: 75152 - Next: Clear imap stream
Memory usage: 75152 - Next: Open connection
Memory usage: 75152 - Next: Imap check
Memory usage: 75152 - Next: Clear $mailboxinfo
Memory usage: 75152 - Next: Fetch Overview
----------Num msg: 10-----
Memory usage: 75872 - Next: Clear Overview
Memory usage: 75872 - Next: Close connection
Memory usage: 75872 - Next: Clear imap stream
Memory usage: 75872 - Next: Open connection
Memory usage: 75872 - Next: Imap check
Memory usage: 75872 - Next: Clear $mailboxinfo
Memory usage: 75872 - Next: Fetch Overview
----------Num msg: 10-----
Memory usage: 76576 - Next: Clear Overview
Memory usage: 76576 - Next: Close connection
Memory usage: 76576 - Next: Clear imap stream
Memory usage: 76576 -------End-------
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35893&edit=1