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 622366 - evolution eats 1.5GB memory after one day, leaking?
evolution eats 1.5GB memory after one day, leaking?
Status: RESOLVED OBSOLETE
Product: evolution
Classification: Applications
Component: Mailer
2.28.x (obsolete)
Other Linux
: Urgent critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks: 627707
 
 
Reported: 2010-06-22 09:40 UTC by Petr Mladek
Modified: 2011-06-02 05:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log; evolution running about 30 minutes; wrote one mail; read some mails; checked few folders (23.07 KB, text/x-log)
2010-06-25 16:32 UTC, Petr Mladek
Details
valgrind log with --leak-check=full (519.14 KB, application/x-bzip2)
2010-07-28 09:42 UTC, Petr Mladek
Details
valgrind log with --leak-check=full and evolution-data-server-debuginfo (434.77 KB, application/x-bzip2)
2010-08-05 09:15 UTC, Petr Mladek
Details

Description Petr Mladek 2010-06-22 09:40:06 UTC
I am using evolution-2.28.2 on SLED11-SP1-x86_64. The memory usage is growing all the day, even during night. I have to restart it every day.

I receive mails from three servers using imap, groupwise, and pop3. I currently have about 1.3GB of mails on the imap server. I use evolution to filter mails from groupwise and pop3 and move them to the imap server.

The memory usage after half a half hour is

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 5692 pmladek   20   0  904m 264m  28m S    0  6.7   0:21.50 evolution.bin      


The memory usage after 24 hours is

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 5141 pmladek   20   0 2232m 1.5g  24m S    1 38.5   8:57.22 evolution.bin      


Please, let me know if you need more information.
Comment 1 André Klapper 2010-06-22 09:56:33 UTC
valgrind logs to identify potential memory leaks are welcome.
Comment 2 Petr Mladek 2010-06-25 16:32:15 UTC
Created attachment 164635 [details]
valgrind log; evolution running about 30 minutes; wrote one mail; read some mails; checked few folders

I am sorry for the delay. This was incredibly crazy week.

I have vacation the following two weeks. I will try to provide better valgring log then (more debuginfo packages, keep it running over night).
Comment 3 Michael Meeks 2010-06-25 16:41:13 UTC
Hi Petr; thanks for the log - unfortunately, it doesn't have the data we would like, can you:

==16494== Rerun with --leak-check=full to see details of leaked memory

so we can get some stack frames of the culprits ? :-)

Thanks.
Comment 4 Domen Kožar 2010-07-20 09:27:21 UTC
Petr, try disabling all plugins with command line switch and test with that.
Comment 5 Petr Mladek 2010-07-28 09:42:13 UTC
Created attachment 166692 [details]
valgrind log with --leak-check=full

I am sorry for the delay. I had vacation...

This time evolution was running over night with valgrind --leak-check=full.

--disable-eplugin did not help. It still ate too much memory when running many hours time.
Comment 6 Michael Meeks 2010-08-03 15:38:23 UTC
ah - wow :-) what a good trace.

Unfortunately, you didn't have evolution-data-server-debuginfo installed - so the traces are fragmentary; but interesting nonetheless.

Things like:

==7256== 57,578,249 bytes in 730,337 blocks are definitely lost in loss record 20,789 of 20,790
==7256==    at 0x4C261D7: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7256==    by 0x11C28AD2: g_malloc (in /usr/lib64/libglib-2.0.so.0.2200.5)
==7256==    by 0x11C406CD: g_strdup (in /usr/lib64/libglib-2.0.so.0.2200.5)
==7256==    by 0x1CF1EF42: soup_soap_parameter_get_string_value (in /usr/lib64/libegroupwise-1.2.so.13.0.1)
==7256==    by 0x1CF09A57: e_gw_connection_get_all_mail_uids (in /usr/lib64/libegroupwise-1.2.so.13.0.1)
==7256==    by 0x24663469: ??? (in /usr/lib64/evolution-data-server-1.2/camel-providers/libcamelgroupwise.so)

are really good to catch :-)
Comment 7 Michael Meeks 2010-08-03 15:59:27 UTC
Ok - the leak above seems to be in:

camel/providers/groupwise/camel-groupwise-folder.c (gw_update_all_items)

which removes items from item_list - by deleting links - without freeing the associated (duplicated) uid - so I guess we leak this UID there; should save some MB over time:

diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index c5bf64d..8a73189 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -2418,6 +2418,7 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, GError **error)
                        camel_folder_change_info_remove_uid (changes, uid);
                        CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
                } else {
+                       g_free (temp->data);
                        item_list = g_list_delete_link (item_list, temp);
                }
                index++;

I've committed to master - but it needs testing & back-porting to previous versions.
Comment 8 Michael Meeks 2010-08-03 16:29:50 UTC
Another MB of un-freed responses - again on master, needs back-porting.

--- a/servers/groupwise/e-gw-connection.c
+++ b/servers/groupwise/e-gw-connection.c
@@ -840,9 +840,11 @@ e_gw_connection_get_container (EGwConnection *cnc, const gchar * uid)
 
                                subparam = soup_soap_response_get_first_parameter_by_name (response, "folder");
                                container = e_gw_container_new_from_soap_parameter (subparam);
+                               g_object_unref (response);
 
                                return container;
                }
+               g_object_unref (response);
 
                return NULL;
 }
Comment 9 David Richards 2010-08-03 16:34:38 UTC
Add me to cc, Groupwise leaks are very helpful to us.
Comment 10 Petr Mladek 2010-08-04 14:49:55 UTC
Should I provide (In reply to comment #6)
> Unfortunately, you didn't have evolution-data-server-debuginfo installed - so
> the traces are fragmentary; but interesting nonetheless.

Should I generate another trace with the debuginfo package installed?
Comment 11 Petr Mladek 2010-08-05 09:15:00 UTC
Created attachment 167167 [details]
valgrind log with --leak-check=full and evolution-data-server-debuginfo

Evolution was running half an hour this time.
Comment 12 Michael Meeks 2010-08-06 09:13:53 UTC
The two patches above (committed to master) fix a large number of 

Well - it looks like gtkhtml is leaking somewhat; and that needs addressing in master and back-porting.

It is also probable that we are leaking CamelFolder references somewhere - that is the bulk of the leakage you report (unrelated to groupwise - just using IMAP). Unfortunately, such leaks are incredibly hard to track down.

Matthew - after your de-bonobo-ification, and camel re-working; are you looking at reference count leaks ? Do we have some built-in debug / reference tracking of what is left un-freed when we exit Evolution normally ? [ it took weeks to free the original Evo of such reference leaks with that in-place ].

I'm also worried that the lifecycle / reference web is weakening ;-) which is of concern.
Comment 13 Matthew Barnes 2010-08-06 11:57:00 UTC
(In reply to comment #12)
> Matthew - after your de-bonobo-ification, and camel re-working; are you looking
> at reference count leaks ? Do we have some built-in debug / reference tracking
> of what is left un-freed when we exit Evolution normally ? [ it took weeks to
> free the original Evo of such reference leaks with that in-place ].

I haven't really looked at reference count leaks for quite awhile, but I can do so again.  There's nothing in Evo itself -- I usually just rely on GObject's rudimentary tools:

    GOBJECT_DEBUG=objects

I had an equally rudimentary enhancement proposal to show even more data at exit, but it never really went anywhere:

    https://bugzilla.gnome.org/show_bug.cgi?id=354457

And that evolved into some fancy dtrace/systemtap integration which is apparently in GLib now but I've never played with it:

    https://bugzilla.gnome.org/show_bug.cgi?id=606044
Comment 14 Matthew Barnes 2010-08-06 11:59:29 UTC
See also: http://blogs.gnome.org/alexl/2010/01/04/tracing-glib/
Comment 15 Milan Crha 2011-03-11 13:27:10 UTC
There were even more common leak fixes done on master, included in 2.91.91.

Could you retest with that version, please? It should behave more sanely.
Comment 16 Jose Ramon 2011-04-10 11:33:44 UTC
Any intentions to fix this for Ubuntu 11.04 ? It is really awful to have to restart Evolution every 5 or 6 hours to free memory .
Comment 17 Akhil Laddha 2011-06-02 05:29:40 UTC
Jose, can you please file a bug in Ubuntu launchpad and let them know the upstream bug id so they can pick patch from here.

Please feel free to open a new bug with valgrind trace if the problem still occurs with a newer version of Evolution 3.0.1 or later, thanks.