#23106 [Fbk->Opn]: imap_fetch_overview hangs with 1000s of messages

From: Date: Tue, 08 Apr 2003 06:09:09 +0000
Subject: #23106 [Fbk->Opn]: imap_fetch_overview hangs with 1000s of messages
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37333@lists.php.net to get a copy of this message
ID: 23106 User updated by: charlesb at ekit-inc dot com Reported By: charlesb at ekit-inc dot com -Status: Feedback +Status: Open Bug Type: IMAP related Operating System: solaris/i86 PHP Version: 4.3.1 New Comment: Yeah, fair question :) My instant answer to this was "no, because imap_sort can read the whole mailbox no problems". But, we briefly redeployed our webmail with this and came up with two things that I hope will be enough: In the error_log: ~GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) ^GOut of memory (Needed 8164 bytes) FATAL: emalloc(): Unable to allocate 40 bytes So we upped the ulimit in apache and it fixed the problem...*but* a standalone server can display the mailbox in question with a lower ulimit. My guess is the imap routine in question is using an unusual memory allocation technique? Hope you can do something with this. Thanks. Previous Comments: ------------------------------------------------------------------------ [2003-04-08 00:26:14] kalowsky@php.net And you're sure this isn't a case of timeouts? I.E. the webserver or the PHP application timing out? Does your IMAP server even show that a connection was established? ------------------------------------------------------------------------ [2003-04-07 23:41:33] charlesb at ekit-inc dot com This is very hard to pin down as (a) there is no error log produced and (b) it does not occur when the server load is small (thus setting up a standalone server with gd doesn't provide anything useful). In a nutshell, the following code crashes apache when there are a large number of messages in the inbox (1000-3000, depending on the server load). There is nothing in the error logs to help, the browser just gives an "unable to locate server" error. $stream = imap_reopen($imp->stream, '{' . "$imp->server:$imp->port". '}' . $preamble . $mboxes[$i], OP_READONLY); $MC=imap_check($imp->stream); $MN=$MC->Nmsgs; $overview=imap_fetch_overview($imp->stream,"1:$MN",0); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23106&edit=1

« previous php.bugs (#37333) next »