Bug 279642 - synchronising folder results in >400 MB additional private dirty memory consumption
Summary: synchronising folder results in >400 MB additional private dirty memory consu...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Mixed Maildir resource (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 08:54 UTC by S. Burmeister
Modified: 2017-01-07 22:33 UTC (History)
3 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 S. Burmeister 2011-08-08 08:54:47 UTC
Version:           unspecified (using KDE 4.7.0) 
OS:                Linux

I have a mixed maildir resource with several ten thousand emails in different folders. After starting up akonadi/kmail2/kontact and navigating a bit that resource uses ~5-15 MB of memory (private dirty). Akonadiserver uses ~4MB, kontact ~40 MB and mysqld ~50MB of memory. I can open different folders with >10000 emails in them, scroll and read emails without any significant increase in memory consumption.

Yet after some time the mixed maildir process suddenly uses 460 MB, akonadiserver 60 MB, kontact 250 MB and mysqld 110 MB of memory, i.e. private dirty memory, and do not release it ever or to be more precise within tens of hours. Closing kontact does not help either regarding akonadi's memory consumption. To get the amount of private dirty memory you can e.g. right click on the process in KDE's system monitor and open the "detailed memory information". 

I can trigger that increase manually by issuing "synchronise folder" on the same folder with >10000 emails in it. So my guess is that kmail2 or something else triggers that "synchronise folder" from time to time when a user clicks on that folder and ends-up with the huge memory consumption for the akonadi + kdepim resource.

To put this into numbers:

Private memory consumption right after starting akonadi (~120 MB including kontact with only kmail2 open: 160 MB):

mysqld 45536 KB dirty

akonadiserver 3836 KB dirty

akonadi_control 1384 KB dirty

akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_2 3708 KB dirty

akonadi_agent_launcher akonadi_ical_resource akonadi_ical_resource_2 4172 KB dirty

akonadi_imap_resource --identifier akonadi_imap_resource_2 6296 KB dirty

akonadi_imap_resource --identifier akonadi_imap_resource_3 6964 KB dirty

akonadi_kabc_resource --identifier akonadi_kabc_resource_4 4752 KB dirty

akonadi_agent_launcher akonadi_maildir_resource akonadi_maildir_resource_1 3824 KB dirty

akonadi_maildispatcher_agent --identifier akonadi_maildispatcher_agent 4140 KB dirty

akonadi_mixedmaildir_resource --identifier akonadi_mixedmaildir_resource_0 4640 KB dirty

akonadi_nepomuk_calendar_feeder --identifier akonadi_nepomuk_calendar_feeder 4092 KB dirty

akonadi_nepomuk_contact_feeder --identifier akonadi_nepomuk_contact_feeder 4040 KB dirty

akonadi_nepomuk_email_feeder --identifier akonadi_nepomuk_email_feeder 7192 KB dirty

akonadi_pop3_resource --identifier akonadi_pop3_resource_5 4096 KB dirty

akonadi_agent_launcher akonadi_vcard_resource akonadi_vcard_resource_2 3656 KB dirty

akonadi_agent_launcher akonadi_vcard_resource akonadi_vcard_resource_3 3660 KB dirty

Increase in private dirty memory consumption after synchronising a folder:
mixed maildir: +450 MB
akonadiserver: +55 MB
kontact: +200 MB
mysqld: +60 MB

That makes a total of 1 GB dirty private memory when using akonadi with kontact.

IMHO opinion this kind of issue is crucial for akonadi's acceptance, simply because it gives people a valid and very easy argument to put off akonadi/kdepim as bloated without even considering its advantages.

Just in case. If you want me to run valgrind, please give me detailed instructions. I hope the issue is easy enough to reproduce.

Reproducible: Always

Steps to Reproduce:
Click on synchronise folder for a folder with >10000 emails in a mixed maildir resource.

Actual Results:  
Private dirty memory consumption of mysqld, akonadiserver, kontact and the mixed maildir resource increases by several hundred MBs

Expected Results:  
Since navigating/reading emails etc. is possible even when the processes only consume a fraction of that memory, they should release the memory (needed) while synchronising after it finished doing so.
Comment 1 Kevin Funk 2011-09-08 11:16:52 UTC
Experiencing the same issue. 

Just counting private mappings, but it's obvious that the shared mappings are negligible. Only the top memory hogs are listed here.

Current statistics:
Kontact - ~600MB
akonadi_mixedmaildir_resource - 160MB
akonadi_nepomuk_emailfeeder - 70MB

Adding mysqld and virtuoso-t and all the Akonadi instances this counts up to 1GB of RAM. Needless to say, this is too much.

I think the interesting question is: Is this issue going to be addressed in near future? As the reporter said, this is crucial for the future of KDEPIM.

I'm also offering help to make this thing use less RAM.
Comment 2 Denis Kurz 2016-09-24 20:33:59 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 3 Denis Kurz 2017-01-07 22:33:06 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.