Bug 258729 - KMail2 launch is very slow
Summary: KMail2 launch is very slow
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail2
Classification: Applications
Component: message list (show other bugs)
Version: 2.0.89
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 20:47 UTC by Valentin Rusu
Modified: 2015-09-11 19:31 UTC (History)
8 users (show)

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 Valentin Rusu 2010-12-03 20:47:20 UTC
Version:           2.0.89 (using KDE 4.5.80) 
OS:                Linux

I'm a long time user of KMail, so KMail2 migration found me with lots of mails :)
The problem : now, KMail2 launch-to-ready time is quite long. And I configured the message list in flate mode though.
I suppose that loading messages in a background thread would do, provided that list loading would start with the most recent messages akonadi holds, such as new and unread messages.


Reproducible: Always

Steps to Reproduce:
Just start Kontact with 1 Gb worth of messages (I have 7323 messages in my main folder)


Actual Results:  
Application is long to get ready.

Expected Results:  
Application ready to use withing seconds from launch time.
Comment 1 Silver Salonen 2010-12-12 10:42:54 UTC
I have 2 quite big IMAP accounts and the overall experience with KMail is so slow that it is just unusable. So I'm temporarily on webmails instead :(
Comment 2 Hal V. Engel 2011-02-05 20:25:42 UTC
I am also seeing this same issue on version 4.5.94.1 of kdepim.  I am running kde SC 4.6.  

Kmail2 is slow to the point of not being usable.  Also akonadi uses massive amounts of memory and this results in my whole system being unusable.  Why does an email program need 3.5G of virtual memory?
Comment 3 zless 2011-02-05 22:34:22 UTC
The migration was faulty in my case. I had only one IMAP account but folders showed up empty after the migration. I tried deleting the account (that's the beauty of IMAP ;) ) and recreated it in Kmail2 with no success.

After a system reinstall with all the upgrades pushed till KDE 4.6.0 and only after that setting up an email account Kmail2 is wonderful.

So, the bottom line is - the migration is faulty, it breaks something deeper than Kmail, I suspect something Akonadi related.
Comment 4 Matthias 2011-06-13 23:13:19 UTC
Same problem here. Have many big IMAP accounts and kmail2 is way to slow to use.
I'm using akonadi with a local MySQL-Daemon and every x minutes the MySQL-Daemon needs 100% CPU from one of the cores. akonadi_imap_resource also needs a hugh amount of CPU when checking for mails.

After adding all my IMAP-accounts (readded them because the migration was faulty), i have 2.500.000 records in the database (790 MB).

I restarted after the syning and now after 3.5 hours and the server executed 804k querys (63.05/second). 

That's really a bummer :-( I always loved kmail...
Comment 5 François Rey 2011-07-09 09:10:10 UTC
KMail 2.1.1 is also very slow here, however I'm using a regular kmail maildir with 80000+ items (no imap). Fist I had troubles migrating from kdepim 4.4 to 4.6, see this comment for more info:
https://bugs.kde.org/show_bug.cgi?id=273612#c5

I thought the slowdown was due to the failed migration messing up akonadi. So I basically removed every files from akonadi and kmail and restarted from new, creating new akonadi resources in which I imported the data. Contacts and Calendar imported fine, but the mail part is so slow that it's barely usable at all. Unlike with my previous setup just after migration where akonadi also used lots of memory, this time only kontact use a large amount of memory and akonadi_agent_l lots of io. Just see the process info at the end of this comment: kontact uses almost 5Gb of RAM out of 8Gb!

My guess is that there's something wrong in kmail and large mail resources, regardless of imap or maildirs.

I'm now considering deleting .index and .index.ids files and let kmail rebuild them. But since IMAP probably don't have such files (do they?) I fear this may not be where the bug is.  Will let you know how it works.

Process 5529 - kontact

Summary

The process kontact (with pid 5529) is using approximately 4.7 GB of memory.
It is using 4.7 GB privately, and a further 8.2 MB that is, or could be, shared with other programs.
Dividing up the shared memory between all the processes sharing that memory we get a reduced shared memory usage of 873.0 KB. Adding that to the private usage, we get the above mentioned total memory footprint of 4.7 GB.
244.8 MB is swapped out to disk, probably due to a low amount of available memory left.
Library Usage

The memory usage of a process is found by adding up the memory usage of each of its libraries, plus the process's own heap, stack and any other mappings, plus the stack of its 2 threads. 
Private
more
4944612 KB	[heap]
276 KB	/usr/lib/libkdeui.so.5.6.0
268 KB	/usr/lib/libakonadi-kde.so.4.6.0
228 KB	/usr/lib/libmessagelist.so.4.6.0
220 KB	/usr/lib/libQtGui.so.4.7.3
Shared
more
2180 KB	/usr/lib/libQtGui.so.4.7.3
1092 KB	/usr/lib/libQtCore.so.4.7.3
652 KB	/usr/lib/libkdecore.so.5.6.0
468 KB	/usr/lib/libakonadi-kde.so.4.6.0
440 KB	/lib/libc-2.14.so
Totals

Private	4947296 KB	(= 340324 KB clean + 4606972 KB dirty)
Shared	8392 KB	(= 8392 KB clean + 0 KB dirty)
Rss	4955688 KB	(= Private + Shared)
Pss	4948169 KB	(= Private + Shared/Number of Processes)
Swap	250684 KB
Comment 6 Tammo Tjarks 2011-08-26 11:23:36 UTC
Hello,
I observe the same problem. It is really unnerving and kmail2 is not properly usable due to the fact, that it is so slow. Even each time I change the mail folder it starts again with:
Synchronizing email folder ...

But this synchronization is also done at startup. Furthermore it seems, that at each startup the emails are filtered again. At least I see always again the info that the emails are filtered. Is there a way, that kmail2 will get more efficient?
Comment 7 Karsten König 2012-02-29 13:36:31 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Martin Steigerwald 2015-09-11 19:31:08 UTC
Thank you Valentin for your report and all the commenters for your comments.

It is about a version of KMail which uses Nepomuk and is unmaintained. Thus
closing. If you still see performance issues please open new reports. But
please follow the following guide lines to avoid unnecessary work for the
developers:

- Ideally test with KDEPIM and Akonadi 15.08. It contains some performance
improvements like the binary protocol.

- Otherwise at least use KDEPIM 4.14.10 and newest Akonadi 1.13 you can get as
it already contains some performance improvements.

- If you can wait, please retest with KDEPIM and Akonadi 15.12 once they become
available for you. Akonadi 15.12 will contain *massive* performance
improvements implemented by Dan due to new database indexes, optimized queries
and leveled file_db directory. All of these are in master already, so if you
dare use kdesrc-build to compile KF5, kdepim and kdepim-runtime. I am using
this currently and it basically moves the bottleneck to KMail (displaying message list
of huge folder). It is a *huge* improvement. And also Volker and Dan work to improve
message list display speed as well.

Thank you and greetings from KDE Randa Meetings,
Martin