Bug #73493 [Asn->Nab]: imap_fetchbody() [still] leaks memory

From: Date: Wed, 25 Jan 2017 09:50:00 +0000
Subject: Bug #73493 [Asn->Nab]: imap_fetchbody() [still] leaks memory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206937@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73493&edit=1 ID: 73493 Updated by: mike@php.net Reported by: leeoniya at gmail dot com Summary: imap_fetchbody() [still] leaks memory -Status: Assigned +Status: Not a bug Type: Bug Package: IMAP related Operating System: Win10 x64 PHP Version: 7.0Git-2016-11-11 (snap) Assigned To: mike Block user comment: N Private report: N New Comment: These are no "leaks" per se. The c-client library performs a lot of caching, if you want to clean the caches, use imap_gc() <http://php.net/imap_gc>. See the diagrams at http://imgur.com/a/RRYXg for a comparison of a session with and without calling imap_gc(IMAP_GC_TEXTS) every now and then. Previous Comments: ------------------------------------------------------------------------ [2016-11-11 04:55:17] leeoniya at gmail dot com Description: ------------ It looks like this was an issue in the past that was resolved [1], but it looks like this is still a problem. If you run attached code on a mailbox of a few hundred messages, you can see the mem grow continuously. Using imap_savebody() also leaks. [1] https://bugs.php.net/bug.php?id=47940 Test script: --------------- $imap = imap_open(IMAP_PATH, IMAP_USER, IMAP_PASS); $uids = imap_sort($imap, SORTARRIVAL, 1, SE_UID | SE_NOPREFETCH); $len = count($uids); for ($i = 0; $i < $len; $i++) $raw = imap_fetchbody($imap, $uids[$i], "", FT_UID | FT_PEEK); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73493&edit=1

« previous php.bugs (#206937) next »