Bug 229423 - kmail 1.13.1: Online IMAP almost unusable in this version (I did not check other versions)
Summary: kmail 1.13.1: Online IMAP almost unusable in this version (I did not check ot...
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.13.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-04 17:58 UTC by Marc Schiffbauer
Modified: 2012-03-19 09:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer 2010-03-04 17:58:13 UTC
Version:           1.13.1 (using KDE 4.4.1)
OS:                Linux
Installed from:    Gentoo Packages

Hi,

I really love kmail being my favorite mail-client for some years now with a dimap-account.
Now I have another account which I only want to view like a REAL IMAP account (no offline cache).
But this feature seems to be almost unusable in kmail in the current version:

IMAP-Server: Cyrus-IMAP 2.2.13
Client: Core2 Duo CPU, 3GB RAM
Internet-Connection: 100MBit DOWNstream / 10MBit UPstream
Mailbox: ~6500 Messages in INBOX, plus about 25 subfolders (~35000 msg in total)

Using mutt: 
After deleting the header cache, downloading all headers lasts about 2 seconds for INBOX (at startup of mutt). Memory usage: ~14M

Using Thunderbird: 
Getting all headers after creating the account in TB lasts about 5 seconds, after that I am instantly able to read any mail by clicking on it while TB is syncing the Mailbox in background (it does not distinguish between Online and Offline IMAP). Memory usage: ~75M
Background syncing the whole mailbox finished in about 15 minutes.

Using kmail 1.13.1:
Kmail startup, no online IMAP account yet.
Memory usage: ~54M
After creating the Online IMAP account and selecting its INBOX, this is what happens:
(I have the column enabled that shows the number of mails being in a mailbox)
* The counter of all messages in the iNBOX starts to increase and finally reaches ~6500 after about 15 seconds
* I see a white message screen and after another ~50 seconds kmail displays the message list
(while this was happening one CPU core was on 100% and memory usage now is: ~400M (!!) and increasing
* now kmail starts a background transfer, as it seems for all mails in that mailbox. WHY? and while the message count is now *DEcreasing* slowly, the consumed memory is dramatically INcreasing (and I have a high CPU load of about 70%).
* after 1 minute (15:47): I can select some header line in the message list, but it won't display in the message view
* after 3 minutes: the message count has decreased to 5000. Mem usage now: ~800M
* after 5 minutes: still no message in the message view (I did not select another one)
* after 10 minutes: msg count: 3900, mem usage: 1020M
* after 23 minutes: msg count: 1600, mem usage: 1500M
* after 30 minutes: msg count:  800, mem usage: 1720M
* (starting to close some other applications like akregator or knotes as my machine starts swapping)
* after 36 minutes: msg count: 0, mem usage 1920M
* now the message list is really empty again.
* message list stays empty, background processing tells me that it now is UPLOADING messages to my account?
* WTF??? is now eating my whole mailbox? I just wanted to READ mails nothing else...
* looking with my webmail account, the message count the in the mailbox is increasing quickly
* 40 minutes later: 
  - CPU usage is sown again. 
  - mem usage: still 1880M (!)
  - message list is shown again
  - clicking on an item in the list makes the message appear in 0.5 to 2 seconds

* after clicking about 4-6 message kmail crashed 
  (reported here https://bugs.kde.org/show_bug.cgi?id=229419)

* after the restart, kmail behaves more normal: Seems like the index on disk was still ok after the crash. Messages are shown more quickly now. Almost as I would it expect it or like mutt or Thunderbird did immediately.

* Looking at the local disk, the index directory for that imap account is 9.7M in size.
* looking at my webmail, my mailbox seems to be to normal.


So the main question is: WTF is kmail doing with all the mails in the mailbox after fetching the headers in an ONLINE IMAP account? What is it doing all the time when it is eating all that memory and CPU ressources for about 1.5 hours?

Another note: It seems, that if I use that imap account from other clients too long without using kmail, the whole procedure will start again.
Comment 1 Thomas McGuire 2010-03-04 18:08:34 UTC
Looks like your filters are triggering the download and upload of all messages. That is a known problem with online IMAP (reported elsewhere already), I recommend disabling the filters for online IMAP accounts or using disconnected IMAP.

The crash is unrelated to that (also a duplicate, of bug 186502), I hope I have time to look into that before 4.4.2.
Comment 2 Marc Schiffbauer 2010-03-04 20:29:47 UTC
Thanks Thomas, after setting every filter to not being used with Online IMAP it works as expected.

If this is known to cause such problems, why is this not the default setting?

Another thing: What would be nice is a setting per Mail-Account where you can set if filters should be applied at all or not. This way I would have had to set only one switch in the IMAP account instead of touching every single filter (which will be a real PITA if there are al lot of them)

And what about the mem usage? Is this really expected?

Thx
-Marc