Bug 278487 - akonadi eats my memory ;)
Summary: akonadi eats my memory ;)
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 1.6.0
Platform: Archlinux Linux
: NOR major with 80 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2011-07-25 17:13 UTC by Christoph Cullmann
Modified: 2016-08-28 12:51 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Cullmann 2011-07-25 17:13:03 UTC
Version:           unspecified (using KDE 4.6.5) 
OS:                Linux

I have configured KMail from KDE 4.6.5 to connect to my IMAP account.
The account contains > 400k mails, in short: a lot ;)
Now, even if I don't start KMail after logging in, akonadi starts up and eats my memory (and sometimes my CPU).

I have 4 GB of memory and no swap, got OOM'd just now without any applications open beside one chrome + amarok.

once it killed akonadi:
[ 2563.614023] Killed process 1728 (akonadi_nepomuk) total-vm:632676kB, anon-rss:224724kB, file-rss:4kB

later chrome (which did not take lot RAM)
[ 6020.429589] Killed process 1736 (chromium) total-vm:931484kB, anon-rss:90960kB, file-rss:7036kB

Even now, after some OOM'd doom, I have running:

cullmann  1052 12.9  2.8 513920 117432 ?       Sl   17:53   9:41 akonadiserver
cullmann  1056  5.7  2.6 477820 108896 ?       Sl   17:53   4:18 /usr/bin/mysqld --defaults-file=/home/cullmann/.local/share/akonadi//mysql.conf --datadir=                  
cullmann  1108  0.0  3.5 353736 145156 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_0
cullmann  1109  0.0  3.5 353728 145260 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_1
cullmann  1110  0.0  3.5 353740 145136 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_2
cullmann  1111  0.0  3.5 353740 145280 ?       Sl   17:53   0:04 /usr/bin/akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_3
cullmann  1112  0.0  3.5 349712 145132 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_contacts_resource akonadi_contacts_resource_0
cullmann  1113  0.0  3.5 349680 145032 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_contacts_resource akonadi_contacts_resource_1
cullmann  1114  0.0  3.5 352260 145164 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_ical_resource akonadi_ical_resource_0
cullmann  1115  0.0  3.5 352296 145196 ?       Sl   17:53   0:04 /usr/bin/akonadi_agent_launcher akonadi_ical_resource akonadi_ical_resource_1
cullmann  1116  0.1  0.4 482756 19032 ?        Sl   17:53   0:04 /usr/bin/akonadi_imap_resource --identifier akonadi_imap_resource_0
cullmann  1117  0.0  3.5 353732 145148 ?       Sl   17:53   0:03 /usr/bin/akonadi_agent_launcher akonadi_maildir_resource akonadi_maildir_resource_0
cullmann  1118  0.1  0.1 290916  4392 ?        S    17:53   0:04 /usr/bin/akonadi_maildispatcher_agent --identifier akonadi_maildispatcher_agent
cullmann  1119  0.1  3.5 440956 145300 ?       Sl   17:53   0:05 /usr/bin/akonadi_nepomuk_calendar_feeder --identifier akonadi_nepomuk_calendar_feeder
cullmann  1124  0.1  3.5 438292 145220 ?       Sl   17:53   0:04 /usr/bin/akonadi_nepomuk_contact_feeder --identifier akonadi_nepomuk_contact_feeder
cullmann  1141  0.0  3.5 349728 145116 ?       Sl   17:53   0:04 /usr/bin/akonadi_agent_launcher akonadi_vcard_resource akonadi_vcard_resource_0
cullmann  1170  0.0  0.0 136488  1928 ?        S    17:53   0:00 /usr/bin/nepomukserver
cullmann  1730  0.0  7.2 712816 291916 ?       Sl   18:06   0:00 /usr/bin/akonadi_nepomuk_email_feeder --identifier akonadi_nepomuk_email_feeder

File indexing is off (nepomuk itself, too, in system settings, still it is launched)

I know, I have a LOT of mails, but why does it seems to that the akonadi storage tries to download it behind my back and index or whatever it?
Have not activated any offline features.

Reproducible: Sometimes

Steps to Reproduce:
Starting up my KDE session after having configured the IMAP account. Without any configured IMAP account, all is fine (which is no real suprise, as then nothing is there to leech ;)

Actual Results:  
OOM session or hanging session cause of load.

Expected Results:  
Akonadi should be off without KMail starting (but perhaps that is the panel clock or such stuff, not that there is an option), but in any case, even if KMail is started, it should not use that much real memory. With the "old" KMail from KDE 4.6.4 it was just fine, no real memory usage that bothered me.

This is plain ArchLinux packages, 4.6.5, not testing, no own compiles/changes. Settings were plain new, installed this machine fresh with this KDE version (and cleaned .kde and .local stuff)

Major, because that OOM's randomly my other apps. (which doesn't only include poor old SC2 ;)
Comment 1 Christoph Cullmann 2011-07-25 17:14:54 UTC
akonadictl --version tells me it is Akonadi 1.5.3
Comment 2 Christoph Cullmann 2011-07-25 17:15:55 UTC
Beside, without akonadi (after enforce akonadictl stop), I have 3006904 bytes free, around 3GB, with it, I am OOM ;)
Comment 3 Christoph Cullmann 2011-07-31 17:50:21 UTC
KDE 4.7 is the same.
Even without KMail starting, akonadi does stuff with my mails and if I startup KMail, I can't view any folder until it has synced all mails which takes ages for my account.
The "old" KMail just worked and only downloaded the folder I viewed.
Comment 4 Christoph Cullmann 2011-07-31 17:50:54 UTC
up akonadi version
Comment 5 Christoph Cullmann 2011-08-03 10:20:15 UTC
Has anyone any idea about this? Makes KDE as whole unusable as soon as my IMAP account is configured. (sure I can remove the account, but whats the point then)
Comment 6 Christoph Cullmann 2011-08-08 08:09:16 UTC
The Kubuntu 4.7 packages seems to have less problems. Still around 25% of my memory are used by akonadi and co. and it now downloads since more than hour the "headers" after imap account initialisation. I can't read my Kate mailfolder, as it won't load it until it is finished it seems.
Status bar shows "100%" thought every few minutes a new folder is synced (as can be seen in tooltip of status bar)
Comment 7 Christoph Cullmann 2011-08-08 08:12:17 UTC
With just KMail on it now emptied the battery of this T410s as nepomuk takes 100% CPU the whole time to "index" the mail headers?
Comment 8 Frank Steinmetzger 2011-09-05 12:42:45 UTC
There are a number of related bugs, which makes it hard to decide where to write this. I picked this one because it’s more recent.

Firstly: The reason for Akonadi running without KMail loaded is that KMail is only one _possible_ frontend to Akonadi's mail storage. Fair enough, I understand that reason.

But I, too, am quite appalled by Akonadi's recent performance, it's been getting on my nerves big time over the last weeks (though, unlike the OP, I’ve never run out of memory so far, having 3 GB or RAM). IIRC it was much better with 4.6.0.

Secondly: in current KDE (4.7.0) it considerably delays desktop readiness after login, it almost feels like Windows XP with Norton Internet Security and Nero Suite registered for autostart. ;-p

Thirdly: Akonadi repeatedly seems to juggle around mails, as I get prolonged disk load with accompanying CPU load on a regular basis. Maybe that's connected with the automatic check for new mails.
I could be over-sensitive to this because my laptop is getting old and I need to do some maintenance on the cooling system, and the additional load adds to that problem. Plus, laptop HDDs aren’t so fast to begin with, so the system becomes sluggish because loading of files is hampered.

Akonadi is supposed to be a database-aided cache, and for that it needs to make sure the cache corresponds with the actual content after login. But surely there must be ways to improve this.

Added to that as a forth point, even with the frequent system load to maintain the cache, KMail still needs half a minute to display a mailing list folder for the first time. Where is the advantage of the cache here? I was told in #kontact to disable threading in order to speed that up, but (to me) threading would only explain CPU load, not the amount of disk shuffling.

I don't have _that_ many mails, here’s a coarse measurement for my setup:
$ cd ~/.kde4/share/apps/kmail/
$ find mail/ dimap/ -type f | wc -l

<ramble> I can imagine that many current KMail users are from old times that stick with it because they are used to it, know its powers or want to stick to KDE-only programs. But imagine a new user: all he will say is “I’ll use something else, KMail is just too slow for me.” (and it’s not even KMail’s own fault here) </ramble>
Comment 9 meyerm 2012-04-01 23:05:38 UTC
I experienced the same problem with akonadi_imap_resource sucking up all my memory and CPU (Quad-Core i7 with 8GB RAM and 2GB swap). The computer gets unuseable until it OOMs. Since a lot of similar bug reports were closed with "FIXED" telling the people to use KDE 4.8 I took the risk and updated my openSUSE 12.1 with the KDE 4.8 repository to KDE 4.8.1 and akonadi 1.7.1. No luck, still eating 10GB of RAM (and who knows what it would fo if I would add more RAM to the game ;-) )... So for now I am a little bit perplexed how to get back to work with my PIM data.
Comment 10 meyerm 2012-04-02 07:08:59 UTC
After deleting the offending IMAP resource and recreating it in KMail I was able to get back into kontact (for now...). Bug #265896 is most probably related.
Comment 11 Sergio Martins 2013-07-12 18:26:17 UTC
Anyone still seeing this ?
Comment 12 roucaries.bastien+bug 2014-08-20 12:33:18 UTC
i can confirm with newer version 4.13.3 of kdepim and 1.12.1 of akonadi server
Comment 13 Julius Schwartzenberg 2015-01-24 22:16:12 UTC
Also occurs on Kubuntu 14.04, just setting up an IMAP account in KMail causes a lot of problems due to low memory here.
Comment 14 Christoph Cullmann 2016-08-28 12:51:03 UTC
I guess we need more specific info to track this down and a lot of things changed for KF5.
I close my bug, if somebody has more useful info, create a new one please.