Bug 222601 - akonadi_imap_resource allocates an enormous amount of memory
Summary: akonadi_imap_resource allocates an enormous amount of memory
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords: akonadi-ports-regression
: 247605 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-13 22:30 UTC by Dennis Schridde
Modified: 2011-08-10 09:34 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the resource consumption of akonado* processes (102.86 KB, image/png)
2010-05-04 12:56 UTC, Sascha Peilicke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2010-01-13 22:30:33 UTC
Version:           4.4_rc1 / 4.3.90 (using Devel)
Compiler:          gcc 4.4.2 Gentoo 4.4.2 p1.0
OS:                Linux
Installed from:    Compiled sources

akonadi_imap_resource allocates an enormous amount of memory. htop tells it uses about 25% of my system memory, which is ~256MB. That is a rather large amount for something fetching emails... In fact it is even more than the 5% akonadiserver needs.
Comment 1 Dennis Schridde 2010-01-13 22:40:12 UTC
Usage even grows to above 40%, which is really unacceptable. Might even be a memleak.
Comment 2 Dennis Schridde 2010-01-13 22:48:23 UTC
The memory consumption was measured with htop, MEM column and corresponds likely to the RES amount allocated, not the total amount the process uses.
Comment 3 Dennis Schridde 2010-01-13 23:01:23 UTC
/proc/<pid>/status shows (approx)
VmRSS: 310000kB
VmData: 320000kB
Comment 4 Kevin Ottens 2010-01-26 11:47:01 UTC
SVN commit 1080472 by ervin:

Fixing some minor leaks in KIMAP.

CCBUG: 222601


 M  +2 -2      job.cpp  
 M  +3 -1      session.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1080472
Comment 5 Morten Sjoegren 2010-04-28 00:47:04 UTC
I've the same problem. "akonadi_imap_resource" just keeps allocating memory until it runs out of RAM and crashes.

I'm running archlinux on 64bit with KDEmod-4.4.2.

Akonadi is version 1.3.1 and is configured to connect to my gmail via imap and have nepomuk-feeders added.

From ps aux:
"mabs     28065 14.6 82.4 5728292 3128868 ?     Dl   00:13   0:36 /usr/bin/akonadi_imap_resource --identifier akonadi_imap_resource_1"
Comment 6 Sascha Peilicke 2010-05-04 12:56:18 UTC
Created attachment 43224 [details]
Screenshot showing the resource consumption of akonado* processes
Comment 7 Sascha Peilicke 2010-05-04 12:57:07 UTC
When using akonadi_imap_resource from SVN r1120032, it also consumes a considerable amount of RAM when syncing a disconnected IMAP account (related to bug 236305).

More specifically it makes akonadiserver and mysqld consume the resources (see attached screeny).
Comment 8 Alexey Shvetsov 2010-08-11 16:56:02 UTC
Same here on gentoo with kdepim{,-runtime}-4.4.92 and  gcc 4.4.4
in kde sc 4.5.0 env
Comment 9 Christophe Marin 2010-09-14 21:02:43 UTC
*** Bug 247605 has been marked as a duplicate of this bug. ***
Comment 10 Alejandro Nova 2010-09-15 04:16:48 UTC
I filed a duplicate bug (:() and confirm: KDE PIM/Akonadi 4.4.92 is severely affected by this bug. OTOH, KDE PIM/Akonadi 4.4.93 has improved on my computer by a factor of ten (before: more than 1 GB of memory eaten, now: ~100 MB, an inbox with ~20,000 mails).

Please, can we have a retest?
Comment 11 Kevin Ottens 2010-09-15 07:11:39 UTC
It's even better since r1174904. So should be fixed now.
Comment 12 GDR! 2011-08-02 16:25:09 UTC
This is still happening with Akonadi 1.5.2 from Kubuntu (KDE 4.6.2), I'm not sure if it's newer or older than r1174904. After a few hours of uptime, it uses 2 gigabytes of memory and it's growing. It's also using 17% CPU and is often found in D state, doing something to the disk and appearing on the top in iotop.

gdr@gdr-desktop:~$ cat /proc/2397/status 
Name:   akonadi_imap_re
State:  D (disk sleep)
..........
VmPeak:  2286584 kB
VmSize:  1762296 kB
VmLck:         0 kB
VmHWM:   1764392 kB
VmRSS:   1370532 kB
VmData:  1427888 kB
VmStk:       136 kB
VmExe:       332 kB
VmLib:     56000 kB
VmPTE:      3296 kB
VmSwap:        0 kB
Threads:        3
SigQ:   0/16382
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001000
SigCgt: 00000001800104e8
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: ffffffffffffffff
Cpus_allowed:   f
Cpus_allowed_list:      0-3
Mems_allowed:   00000000,00000001
Mems_allowed_list:      0
voluntary_ctxt_switches:        921354
nonvoluntary_ctxt_switches:     105068
Comment 13 Alejandro Nova 2011-08-02 18:12:12 UTC
GDR!, there was a wacky confusion about the Akonadi stack during the KDE 4.6 cycle. Try again with KDE PIM 4.6.1 and Akonadi 1.6.0, or, better yet, with KDE 4.7 (featuring KDE PIM 4.7, it's almost the same as KDE PIM 4.6.1 plus bugfixes). You'll find that in:

ppa:kubuntu-ppa/backports
ppa:kubuntu-ppa/experimental

Add both and retest.
Comment 14 Todd 2011-08-10 09:34:48 UTC
I am still having this problem on openSUSE 11.4 with KDE SC 4.7.  My system grinds to a halt because of this.