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 765121 - Memory leak in goa-daemon
Memory leak in goa-daemon
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
3.20.x
Other All
: Normal major
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-04-15 18:54 UTC by filipenteixeira
Modified: 2017-04-29 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: Don't leak the provider when coalescing EnsureCredential calls (1.68 KB, patch)
2017-01-05 18:03 UTC, Debarshi Ray
committed Details | Review
kerberos: Don't leak the return_key in sign_in_identity_sync (1.16 KB, patch)
2017-01-05 18:03 UTC, Debarshi Ray
committed Details | Review
daemon: Don't leak the list of providers in goa_daemon_init (770 bytes, patch)
2017-01-05 18:04 UTC, Debarshi Ray
committed Details | Review

Description filipenteixeira 2016-04-15 18:54:11 UTC
I'm using gnome-online-accounts with only 2 services: Last.fm and Google (Calendar, Contacts and Chat)

After about 8 hours of uptime, goa-daemon is using 2.7GiB of memory.
Comment 1 adria.arrufat 2016-09-27 13:28:54 UTC
I can confirm there is a memory leak (goa-daemon uses up to 4-5 GiB after a few hours).
From what I can tell, it is related to the Last.fm account, as removing it "solved" the memory leak.

Thanks in advance
Comment 2 Debarshi Ray 2017-01-05 18:03:15 UTC
Valgrind revealed a few leaks.

I think what made this particularly worse was evolution-data-server (bug 773248 and bug 771547) very aggressively calling EnsureCredentials. There is code in goa-daemon to coalesce such calls to avoid overloading the network, but unfortunately, that code path was leaking.
Comment 3 Debarshi Ray 2017-01-05 18:03:37 UTC
Created attachment 342978 [details] [review]
daemon: Don't leak the provider when coalescing EnsureCredential calls
Comment 4 Debarshi Ray 2017-01-05 18:03:51 UTC
Created attachment 342979 [details] [review]
kerberos: Don't leak the return_key in sign_in_identity_sync
Comment 5 Debarshi Ray 2017-01-05 18:04:05 UTC
Created attachment 342980 [details] [review]
daemon: Don't leak the list of providers in goa_daemon_init
Comment 6 Ray Strode [halfline] 2017-01-05 18:58:05 UTC
Review of attachment 342978 [details] [review]:

seems right. at some point we may want to switch over to using cleanup functions, but this seems better for now.
Comment 7 Ray Strode [halfline] 2017-01-05 19:00:05 UTC
Review of attachment 342979 [details] [review]:

eek, yup
Comment 8 Ray Strode [halfline] 2017-01-05 19:01:46 UTC
Review of attachment 342980 [details] [review]:

++
Comment 9 Debarshi Ray 2017-01-06 12:15:05 UTC
Pushed to master, gnome-3-22 and gnome-3-20.
Comment 10 Debarshi Ray 2017-01-06 12:15:19 UTC
Thanks for the review, halfline!