From dev-return-72965-apmail-geronimo-dev-archive=geronimo.apache.org@geronimo.apache.org Fri Apr 03 12:10:37 2009 Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 35724 invoked from network); 3 Apr 2009 12:10:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 12:10:37 -0000 Received: (qmail 19016 invoked by uid 500); 3 Apr 2009 12:10:36 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 18930 invoked by uid 500); 3 Apr 2009 12:10:36 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 18922 invoked by uid 99); 3 Apr 2009 12:10:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 12:10:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 12:10:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 49979234C48C for ; Fri, 3 Apr 2009 05:10:13 -0700 (PDT) Message-ID: <980835105.1238760613300.JavaMail.jira@brutus> Date: Fri, 3 Apr 2009 05:10:13 -0700 (PDT) From: "Rick McGuire (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Commented: (GERONIMO-4584) Opening an IMAP folder with *logs* of emails is very expensive in terms of memory and cpu In-Reply-To: <111961557.1236853850909.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-4584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695355#action_12695355 ] Rick McGuire commented on GERONIMO-4584: ---------------------------------------- Guillaume, I committed a fix attempt at this in revision 761642. Could you try this out to see if it fixes your problem? Rick > Opening an IMAP folder with *logs* of emails is very expensive in terms of memory and cpu > ----------------------------------------------------------------------------------------- > > Key: GERONIMO-4584 > URL: https://issues.apache.org/jira/browse/GERONIMO-4584 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: mail > Reporter: Guillaume Nodet > Assignee: Rick McGuire > Priority: Minor > > {code} > // this is a real pain, but because we need to track updates > // to message sequence numbers while the folder is open, the > // messages list needs to be populated with Message objects > // to keep track of things. The IMAPMessage objects will not > // retrieve information from the server until required, so they're > // relatively lightweight at this point. > populateMessageCache(); > {code} > {code} > /** > * Populate the message cache with dummy messages, ensuring we're filled > * up to the server-reported number of messages. > * > * @exception MessagingException > */ > protected void populateMessageCache() { > // spin through the server-reported number of messages and add a dummy one to > // the cache. The message number is assigned from the id counter, the > // sequence number is the cache position + 1. > for (int i = messages.size(); i < maxSequenceNumber; i++) { > messages.add(new IMAPMessage(this, ((IMAPStore)store), nextMessageID++, i+1)); > } > } > {code} > The above code comes from http://svn.apache.org/repos/asf/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/IMAPFolder.java. > When trying to open my gmail account using IMAP, this takes a long time and an enormous amount of memory (500 Mb) just to open the folder. > It might be a good idea to revisit this code if possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.