After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564727 - evolution-data-server eats memory like crazy
evolution-data-server eats memory like crazy
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.28.x (obsolete)
Other All
: Normal critical
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2008-12-16 12:25 UTC by Chris Coulson
Modified: 2010-06-07 00:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
process information over time from evolution (42.33 KB, text/plain)
2008-12-17 08:38 UTC, Daniel Albeseder
  Details
valgrind --tool=massif output (49.28 KB, application/x-bzip)
2008-12-30 22:40 UTC, pfjan
  Details
Valgrind log of evolution-data-server-2.28 (33.21 KB, application/x-bzip)
2010-02-21 07:41 UTC, VR
  Details
eds patch (1.54 KB, patch)
2010-02-22 11:34 UTC, Milan Crha
committed Details | Review
New Evolution Valgrind log with evolution-data-server-dbg package installed. (36.42 KB, application/octet-stream)
2010-02-22 21:01 UTC, VR
  Details

Description Chris Coulson 2008-12-16 12:25:29 UTC
Please describe the problem:
This bug was reported at https://bugs.edge.launchpad.net/ubuntu/+source/evolution-data-server/+bug/305428 by Andreas Schultz:

"e-d-s grows to 1.5G memory use after about 1day:

top - 11:38:46 up 4 days, 0 min, 12 users, load average: 1.35, 0.78, 0.66
Tasks: 200 total, 2 running, 197 sleeping, 0 stopped, 1 zombie
Cpu(s): 9.0%us, 5.1%sy, 0.0%ni, 85.7%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3987720k total, 3835328k used, 152392k free, 80600k buffers
Swap: 7992296k total, 13144k used, 7979152k free, 766836k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 8229 aschultz 20 0 1530m 1.1g 7912 S 0 29.5 0:49.86 evolution-data-
 7716 root 20 0 385m 228m 97m S 3 5.9 28:52.24 Xorg"

The reporter provided a valgrind log: http://launchpadlibrarian.net/20230538/valgrind.log.gz.

The reporter is using an IMAP account with in excess of 50k e-mails.

Sorry, I don't know what other information to ask from the reporter.

Steps to reproduce:
1. Run Evolution
2. Wait a day or so


Actual results:
e-d-s memory consumption grows

Expected results:
e-d-s should use a sane amount of memory

Does this happen every time?


Other information:
Comment 1 Matthew Barnes 2008-12-16 13:50:10 UTC
IMAP only or does the reporter have other types of accounts?  In particular, NNTP is known to chew up mass quantities of RAM with large newsgroup lists.
Comment 2 Daniel Albeseder 2008-12-17 08:38:04 UTC
Created attachment 124846 [details]
process information over time from evolution

I killed evolution at the end, else the system would became unresponsible due to permanent swapping.
Comment 3 Daniel Albeseder 2008-12-17 08:41:31 UTC
Additional information for the last posting:

I have got evolution-data-server 2.22.3-0ubuntu2 and evolution 2.22.3.1-0ubunut1 installed. I am using IMAP with several folders. The system is

Linux tttdal 2.6.24-22-generic #1 SMP Mon Nov 24 19:35:06 UTC 2008 x86_64 GNU/Linux

When moving several mails at once from one folder to another (by selecting them first and moving them by dragging them to the destination folder) it happens often that the "evolution --mail" process eating up the whole system memory in a couple of seconds.

The behavior is reproducable. However it does not happen always when moving several messages, just with particular combinations. I think it also happen when moving a message while evolution is already connected to the IMAP server checking for new mail.
Comment 4 Andreas Schultz 2008-12-17 08:56:25 UTC
(In reply to comment #1)
> IMAP only or does the reporter have other types of accounts?  In particular,
> NNTP is known to chew up mass quantities of RAM with large newsgroup lists.

IMAP only, actually two IMAP accounts, one living on a Zimbra server, the other on a cyrus IMAP deamon. Plus, a calendar subscription via .ics URL on the Zimbra server.

Would it help to generate a valgrind log including all the still reachable memory?
Comment 5 André Klapper 2008-12-30 21:38:31 UTC
yes, valgrind logs could help to track this down
Comment 6 pfjan 2008-12-30 22:16:25 UTC
Same issue here, since i upgraded to 2.24.2 (ubuntu 8.10). Just that it takes less time for evolution to eat up > 2Gb of memory, and trash my box -- if i don't kill it fast enough. Unfortunately this bug renders evolution pretty useless to me.

I'm also using IMAP, and have 100s of thousands of email (many years accumulated).

Strangely it starts eating up memory even in the background, when i'm not using evolution. I'm not sure what triggers it, but once it starts, i can see it eating up memory at a few megs per second.

Running valgrind (with Memcheck) tells me that most of the memory was correctly returned.

So I ran valgrind --tool=massif to get a heap profile, the result is attached.

Comment 7 pfjan 2008-12-30 22:27:42 UTC
sorry, the file didn't fit the attachment, so i put it here:

http://abstract.homelinux.org:9240/janpf/massif.out.22136

(pls, if someone with more permissions could copy it over and add as an
attachment, it would be great, as that is a temporary space, it has 1.4mb of
text file)

to pretty print the massif output use:

$ ms_print massif.out.22136 | less

look at the last snapshot (end of this output) to have an idea which functions
allocated most of the space.

thx

- jan

Comment 8 pfjan 2008-12-30 22:40:42 UTC
Created attachment 125552 [details]
valgrind --tool=massif output

uncompress and use ms_print massif.out.22136 to see pretty print version
Comment 9 Ferry Toth 2009-01-07 13:19:44 UTC
Yes I happens with my too.

I don't have the possibility to valgrind on my eeepc.

But as far as I can determine e-d-s allocated 8MB blocks every few minutes. This happens even after I close Evolution - as e-d-s stays in the background.

After some ours 200MB is allocated to e-d-s and everything starts becoming sloooow. And then I need to kill e-d-s.

I have imap, caldav and ldap. Memory consumption does not seem to increase extra when I actively use caldav or ldap.

Guess it is imap related as suggested above.

Ferry
Comment 10 André Klapper 2009-01-07 13:42:26 UTC
> I don't have the possibility to valgrind on my eeepc.

Why not?
Comment 11 Matthew Barnes 2009-01-07 14:16:34 UTC
(In reply to comment #9)
> But as far as I can determine e-d-s allocated 8MB blocks every few minutes.
> This happens even after I close Evolution - as e-d-s stays in the background.
> 
> After some ours 200MB is allocated to e-d-s and everything starts becoming
> sloooow. And then I need to kill e-d-s.
> 
> I have imap, caldav and ldap. Memory consumption does not seem to increase
> extra when I actively use caldav or ldap.
> 
> Guess it is imap related as suggested above.

Well, except that IMAP isn't handled by the e-d-s process.
That memory gets flushed when you close Evolution.
Comment 12 pfjan 2009-01-07 15:36:27 UTC
I also have the problem in my eee pc (besides my desktop as reported above). 

But when i kill evolution most of the memory returns -- no need to kill e-d-s.

Btw, by looking at the valgrind output i sent (the massif memory profile), i understand most of the memory is being consumed by the IMAP module.

cheers
- jan
Comment 13 Ferry Toth 2009-01-07 20:59:10 UTC
Well, I use KDE sysguard (debian) or gnomes equivalent (ubuntu) and see evolution-data-server-2.22 (or 2.24) sitting there, even after quitting evolution. Allocated memory by e-d-s does not change - actually continues to increase even with evolution closed.

Ferry
Comment 14 pfjan 2009-01-26 18:06:12 UTC
Interesting, since i upgraded to evolution 2.24.3 (current version in ubuntu 8.10) evolution stopped leaking memory like crazy, so i thought the problem was over.

but now that evolution is able to stay alive for more than a few minutes, i finally see the problem others were describing here: after a couple of days e-d-s is consuming several Gb of memory.

later i'll run valgrind on it and post the results here.
Comment 15 Milan Crha 2009-04-02 17:08:32 UTC
With respect to leaking evolution-data-server, while using CalDAV,
see bug #573187, the fix will be included in 2.26.1.

With respect to evolution itself, it's a different story.
Some valgrind --leak-check=full on 2.26.0 Evolution would help here.
Comment 16 larryoleary 2009-04-09 00:02:09 UTC
Looks like my issue might be addressed by bug #573187 but I am not sure if this has been made available as an update to 2.24?
Comment 17 André Klapper 2009-04-09 08:20:47 UTC
No, it has been only committed to trunk and there won't be any commits to the old stable version.
You could ask your vendor to ship an updated 2.24 version.
Comment 18 Milan Crha 2009-06-26 17:10:09 UTC
Is anybody of you able to run evolution on some real user data with a valgrind as requested in comment #15, on a version 2.26.1+, to check the leaking state of it, please? Thanks in advance.
Comment 19 Carlos Garcia Campos 2009-08-03 08:21:45 UTC
I guess it's another problem because this bug is too old, but it happens again with e-d-s from git master(6344fa54e518041b285320841873f47b8d413206). It doesn't always happen though, which makes it even harder to debug. 
Comment 20 Carlos Garcia Campos 2009-08-03 08:24:00 UTC
btw, I don't use IMAP, so this definetely looks like a different issue, I can file a separate bug report if you want. 
Comment 21 Milan Crha 2009-08-03 09:59:27 UTC
Hi Carlos, nope, let's use this bug report. Just note that eds can leak mainly with your address books and/or calendars. What kinds of these are you using, please? Maybe the leakage depends on the fetching of updates from a remote machine, I do not know. Could you try to run eds under valgrind and see whether it'll happen for you with it, please? I think about something like:
a) close evolution
b) evolution --force-shutdown
c) on one console:
   valgrind --leak-check=full /path/to/your/evolution-data-server-2.28 &>v.log
d) on other console run: evolution
then let it run for some time, I do not know for how long, just try some usual operations and after that close evolution and do:
e) pkill -QUIT evolution-alarm
   or some similar kill -QUIT of the evolution-alarm-notify process.
It should ideally close evolution-data-server in other few seconds. If not, just Ctrl+C it and let valgrind do its job. Thanks in advance.
Comment 22 Akhil Laddha 2009-09-25 06:31:58 UTC
Hey Carlos, did you get time to collect valgrind traces ?
Comment 23 Akhil Laddha 2009-12-31 05:10:31 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!
Comment 24 VR 2010-02-21 07:41:00 UTC
Created attachment 154306 [details]
Valgrind log of evolution-data-server-2.28

This is a log taken from an amd64 Ubuntu Karmic machine, as requested in the message thread.
Comment 25 VR 2010-02-21 07:43:21 UTC
I hope this is enough information for you guys, Milan and Akhil.

Sorry about compressing it; it was too big to upload otherwise.

I've taken it on my Karmic amd64 machine as described in your instructions, Milan. I hope it sheds some light. I stopped logging when Evolution stopped responding, and I don't really know how to read the log, but believe me, had I let it run longer, it would've eaten my memory. I have 4 GB RAM and after an hour or so, evolution-data-server-2.28 eats about 2 GB.

Again, I hope this helps.

Thanks, looking forward to seeing this bug reopened!

Varun
Comment 26 Milan Crha 2010-02-22 11:34:12 UTC
Created attachment 154377 [details] [review]
eds patch

for evolution-data-server;

For the definitely lost memory in the above valgrind log. Those "still reachable" memory pointers are most often correct pointers, some caches.
Comment 27 Milan Crha 2010-02-22 11:42:45 UTC
Thanks for the update. Could you install debug info package for evolution-data-server, please? It' seems it's not installed, as there are lines like this
> ??? (in /usr/lib/evolution-data-server-1.2/extensions/libebookbackendfile.so)
which means it doesn't know the source information.

> ==6582== LEAK SUMMARY:
> ==6582==    definitely lost: 15,247,940 bytes in 3,414 blocks
> ==6582==    indirectly lost: 2,480 bytes in 13 blocks
> ==6582==      possibly lost: 3,500,857 bytes in 28,024 blocks
> ==6582==    still reachable: 382,087 bytes in 3,853 blocks
> ==6582==         suppressed: 0 bytes in 0 blocks

See from the leak summary it was using slightly less than 20MB of memory, why is the rest of eds memory eating so high I do not know, maybe the valgrind was using it to track all the pointers.

I hope I was able to cover most of the leaks with the above patch, though with the debug info packages and source lines it would be more clear.

-------------------------------------------------------------------------

Created commit fd5c2d8 in eds master (2.29.91+)
Created commit bd5527d in eds gnome-2-28 (2.28.3+)
Comment 28 VR 2010-02-22 20:34:20 UTC
Hi all,

I've managed to figure out WHAT was causing the memory leak in eds.

It was happening to me when Pidgin's Evolution Integration plugin was enabled, and Pidgin was running. As soon as I turned off that plugin (or Pidgin itself), eds settled into about 8 megs of usage and didn't waver even a kilobyte for over two days of staying on and active.

NOTE: I didn't even have any accounts selected to synchronize with Evolution; the plugin was simply enabled. It was obviously querying eds without actually sending any "useful" information (at least in my eyes).

I still believe it could be a bug in eds, since the memory leak does happen with eds and not Pidgin.

I've installed the dbg package for eds and am reloading the plugin right now in order to reproduce the initial conditions that caused the memory leak. I will attach the valgrind log shortly.

Thanks!

Varun
Comment 29 VR 2010-02-22 20:58:25 UTC
I'm attaching the valgrind log in a sec...just want to point out that my terminal window that is running Evolution has these statements when that Evolution plugin is enabled in Pidgin:

bbdb: Buddy list has changed since last sync.
bbdb: Synchronizing buddy list to contacts...
bbdb: Done syncing buddy list to contacts.
bbdb: Buddy list has changed since last sync.
bbdb: Synchronizing buddy list to contacts...

So it's doing that repeatedly, and I think eds is just not freeing up memory afterwards. Is that plausible guys?

Thanks, attaching new Valgrind log now. I hope I installed the right packages for the log to be more useful.

Varun
Comment 30 VR 2010-02-22 21:01:38 UTC
Created attachment 154442 [details]
New Evolution Valgrind log with evolution-data-server-dbg package installed.

Same machine as before: amd64 Ubuntu Karmic.

Again, this memory leak is easily reproducible by enabling Pidgin's "Evolution Integration" plugin. There is no need to configure any options (or any accounts to actually synchronize with Evolution), simply enabling the plugin will cause eds to slowly begin chewing memory.

When evolution is run in the terminal, I can see that it's trying to synchronize buddy list with Evolution contacts a fair amount.
Comment 31 Kip 2010-06-07 00:14:14 UTC
Does anyone know if the upstream Pidgin plugin author is aware of this?