#47000 [NoF->Bgs]: imap_body() and imap_savebody() memory leak.
| From: | pajoye@php.net | Date: | Thu, 30 Apr 2009 20:27:19 +0000 |
| Subject: | #47000 [NoF->Bgs]: imap_body() and imap_savebody() memory leak. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136608@lists.php.net to get a copy of this message | ||
ID: 47000
Updated by: pajoye@php.net
Reported By: alan at binarystars dot com
-Status: No Feedback
+Status: Bogus
Bug Type: IMAP related
Operating System: 2.6.25-14.fc9.i686
PHP Version: 5.2.8
-Assigned To:
+Assigned To: pajoye
New Comment:
Duplicate of #47940, which is now fixed in cvs (all active branches).
Previous Comments:
------------------------------------------------------------------------
[2009-01-13 01:00:02] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-01-05 17:17:01] alan at binarystars dot com
iliaa at php.net,
Give me a moment to update. Thanks.
------------------------------------------------------------------------
[2009-01-05 16:01:47] iliaa@php.net
Can you run it via valgrind rather then php's memory checker? I suspect
the issue is just some temp vars that will be cleaned up by garbage
collection.
------------------------------------------------------------------------
[2009-01-04 21:31:09] alan at binarystars dot com
Description:
------------
# Problem:
imap_body() and imap_savebody() memory leak. During the following
test of 26 email messages totaling a sum of 244.05Mb it seems you
need TWICE the amount of memory in order to receive the message body
via imap_body(). When using the imap_savebody() func it seems you
need approximately the same amount of memory as the email message
itself. The problem in particular is repeatable in any size email
message... even when you unset the variables/objects returned by the
func. In other words, you want to receive a message body of 5Mb using
imap_body() func; you'll need 10Mb of available free RAM just to
store the message body to a variable. Now, say you receive 10
messages each at 5Mb, and unset all the variables. That would mean
you'll need 100Mb of free memory to read all ten messages. See the
reproduced code and the results for more information.
# Question:
Is there a way to flush the memory without actually exiting out of
the script?
Reproduce code:
---------------
Colorized version:
http://home.binarystars.com/~alan/imap_bug/test.html
(30k)
Text version:
http://home.binarystars.com/~alan/imap_bug/test.txt
(5.3k)
Result of method 1 via imap_body():
http://home.binarystars.com/~alan/imap_bug/method1_results.txt
(3.6k)
Result of method 2 via imap_savebody():
http://home.binarystars.com/~alan/imap_bug/method2_results.txt
Expected result:
----------------
When I run the script I expect it to use less (RSS) resident memory.
Actual result:
--------------
Instead of freeing up memory the script takes up more than Oracle
running five hundred databases.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47000&edit=1