Bug 307066 - High memory consumption with large local mail setup.
Summary: High memory consumption with large local mail setup.
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.9.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 19:57 UTC by Marcel Wiesweg
Modified: 2017-01-07 21:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kontact and maildir agent memory usage (54.03 KB, application/x-download)
2012-09-30 16:46 UTC, Marcel Wiesweg
Details
massif heap profiling (77.76 KB, application/x-gzip)
2012-09-30 16:48 UTC, Marcel Wiesweg
Details
Massif memory profiling --pages-as-heap=yes (8.20 KB, application/x-gzip)
2012-09-30 16:49 UTC, Marcel Wiesweg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Wiesweg 2012-09-19 19:57:03 UTC
Fresh conversion from KMail 1, local mail setup, about 170000 mails, in subfolders.
Opening KMail, reading new mails in all relevant subfolders. Memory consumption:
kontact      715 MB
akonadi_mixedmaildir 415 MB
akonadiserver         130 MB
mysqld                  107 MB

total: 1,3 GB

I'm talking about the 700 MB in kontact and the 400 MB in the resource. Is this cache? Is this linearly growing data structure? Is this lost memory?
I am aware that a grouped list view with 50000 mails will consume memory. Yet this is a lot.
Memory stays constant, when the mail view show 0 messages, no decrease. 

Reproducible: Always

Actual Results:  
Eats memory

Expected Results:  
Eats less memory
Comment 1 Myriam Schweingruber 2012-09-30 10:54:35 UTC
What exact memory is this? Residual, shared or just virtual? It would be better to provide more precise figures, "top" gives you the details.
Comment 2 Marcel Wiesweg 2012-09-30 16:45:39 UTC
The most beautiful tool for viewing memory consumption is indeed our KDE's system monitor, with a lot of research in it to give valid values. Output is attached.
Note that massif does not really help me; its heap profiling does not come close to the amount of memory used, and --pages-as-heap=yes gives quite different numbers, which dont help me at all. If anyone knows better how to interpret, attached as well.
Comment 3 Marcel Wiesweg 2012-09-30 16:46:29 UTC
Created attachment 74247 [details]
Kontact and maildir agent memory usage
Comment 4 Marcel Wiesweg 2012-09-30 16:48:23 UTC
Created attachment 74248 [details]
massif heap profiling

Memory usage was ~750 MB at the time, not explained from this data.
Gzipped, too large otherwise.
Comment 5 Marcel Wiesweg 2012-09-30 16:49:54 UTC
Created attachment 74249 [details]
Massif memory profiling --pages-as-heap=yes

Data quite difficult to interpret
Comment 6 Jekyll Wu 2012-10-02 12:33:07 UTC
update report status
Comment 7 Sergio Martins 2013-07-18 09:12:05 UTC
Git commit 815957a4a9ae567f271453aac222abf4c09900f9 by Sergio Martins.
Committed on 17/07/2013 at 09:45.
Pushed by smartins into branch 'KDE/4.11'.

mixedmaildir: don't use 1.5GB of memory when importing a very big folder

Subjobs pile up too fast because they are cheap to create and
because it's taking around 5 event loops for one to start.
Related: bug 260647, bug 317122, bug 309732, bug 295651

M  +41   -6    resources/mixedmaildir/retrieveitemsjob.cpp
M  +4    -2    resources/mixedmaildir/retrieveitemsjob.h

http://commits.kde.org/kdepim-runtime/815957a4a9ae567f271453aac222abf4c09900f9
Comment 8 Denis Kurz 2016-09-24 18:23:48 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 9 Denis Kurz 2017-01-07 21:32:01 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.