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
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.