Mark Crispin wrote:
On Mon, 13 Jul 2009, Shawn Walker wrote:
I have an issue that I would like to tell c-client to flush it's cache
since I don't want it to keep headers, body of the messages, etc for
20,000 messages since it take up a lot of memory.
Either mail_free_cache() or use short caching (OP_SHORTCACHE mode of open).
I'm trying OP_SHORTCACHE, but this seems to slow the download messages since now each message has to
be fetched from the server.
What I would like c-client to do is that it knows there are 30,000 messages in a folder. I request
the first 100 messages, either that would be just the envelope or the entire message (depending on
the user's configuration). After I have processed those 100 messages, I want c-client to release
the memory of those messages.
The reason why we have a configuration to allow users to do 'download headers only', 'only download
message of the body', 'don't download attachments' and 'only download attachments if they are less
than X bytes' is because there are countries that have very low bandwidth (Australia has 180k) and
to download huge files can take a long time.
mail_free_cache wouldn't be the ideal function to call since that wipe
out the list of known messages on the server and cannot download any
known messages that I want to download (headers only or just the body
of the message or the attachments).
I have no idea what you mean by this. I have repeatedly read what you
wrote, and I can not make any sense of that combination of words.
The issue with calling mail_free_cache is that the "nmsgs" get reset back to 0 when I'm trying to
get the header, envelope, body or attachment as the message is being downloaded or the user took
some action that I need to get the text of the message or attachment.
Would be ideal that once I have what I wanted downloaded I want
c-client to free all of the memory for that message before I go on to
the next message.
That sounds like short caching, but unless you are running on MS-DOS in
640K, short caching is a very bad idea. UW stopped using short caching
about 10 years ago since it is so horribly inefficient.
If you want to download without going through caching, you can set up a
mailgets function for that purpose.
If you just want to download messages to a local copy, why are you using
IMAP at all? POP would be better for download. If you want to do
interactive access, then you want full caching.
The issue is how the users is storing their messages on the server, some users has 30,000, 100,000
or some ridiculous amount of messages in a folder. Caching all of those messages consume the
memory. It would be nice if the users would managed their folders better, but we can't be dictating
our customers how they should managed their folders.
And not everybody has a computer that has 4 GB of memory, some people in eastern Europe is still
using computers from the mid nineties running Windows 95!
-- Mark --
http://panda.com/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw