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 747929 - freeze and extremely high memory usage with huge address books
freeze and extremely high memory usage with huge address books
Status: RESOLVED OBSOLETE
Product: gnome-contacts
Classification: Core
Component: general
3.20.x
Other Linux
: Normal major
: ---
Assigned To: GNOME Contacts maintainer(s)
GNOME Contacts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-04-15 14:48 UTC by Nicolas Laplante
Modified: 2018-01-24 15:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicolas Laplante 2015-04-15 14:48:55 UTC
After changing address book to a corporate Exchange "Global address list", gnome contact freezes while downloading contacts. A few minutes later, contacts show up and the process uses around 6gb ram and is still frozen.

Fedora 21. Global address list in Exchange contains at least 40,000 entries.
Comment 1 rene.ribaud 2015-11-25 14:09:05 UTC
Seems to appear in Fedora 22 and 23 with 3.16 revision.
Additional information here :
https://bugzilla.redhat.com/show_bug.cgi?id=919889
Comment 2 Josh Triplett 2016-01-07 00:29:24 UTC
I encounter this same problem regularly, and gnome-contacts ends up killed by the OOM killer, but not before the system becomes unusable for a full minute or so.
Comment 3 Markus Ziermann 2016-02-04 10:52:08 UTC
Same here. Large Exchange Global address list eats up all memory, freezing the X session. Evolution 3.18.4. I have to kill both 'gnome-contacts' and 'evolution-addressbook-factory' in order for the hard-disk to calm down and getting the system back to a usable state. Disabling 'Global Address List' in evolution
's contacts preferences seem to fix the memory issue, but leaves you with a disability to use the corporate address book.
Comment 4 Jacob Keller 2016-03-11 17:30:11 UTC
I have the same issue, occurring just now on a fresh installation of Fedora 23. From the Redhat bugzilla, I have a backtrace from a while ago

  • #0 g_ascii_strcasecmp
  • #1 e_vcard_get_attribute
  • #2 e_contact_get
  • #3 _edsf_persona_update_groups
  • #4 edsf_persona_real_get_is_favourite
  • #5 ___lambda23__folks_individual_single_valued_property_setter
  • #6 _folks_individual_update_single_valued_property
  • #7 _folks_individual_update_is_favourite
  • #8 _folks_individual_set_personas
  • #9 folks_individual_set_personas
  • #10 g_object_new_internal
  • #11 g_object_new_valist
  • #12 g_object_new
  • #13 folks_individual_construct
  • #14 _folks_individual_aggregator_add_personas
  • #15 _folks_individual_aggregator_personas_changed_cb.isra.10
  • #16 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
  • #17 g_closure_invoke
  • #18 signal_emit_unlocked_R
  • #19 g_signal_emit_valist
  • #20 g_signal_emit_by_name
  • #21 _folks_persona_store_emit_personas_changed
  • #22 ___lambda11__gsource_func
  • #23 __edsf_persona_store_idle_process_gsource_func
  • #24 g_main_context_dispatch
  • #25 g_main_context_iterate.isra
  • #26 g_main_context_iteration
  • #27 g_application_run
  • #28 _vala_main
  • #29 __libc_start_main
  • #30 _start

I will try to obtain a new backtrace once I notice the problem again.
Comment 5 David Woodhouse 2016-03-14 23:29:21 UTC
Refiling to 3.18; people are still reporting this.
Comment 6 Jacob Keller 2016-04-06 21:46:35 UTC
Ok I had the issue occur on an up to date Fedora 23. I have gdb running on the process. I took a backtrace of all threads, as you can see here:


Thread 1 (Thread 0x7f846369da80 (LWP 8722))

  • #0 vfprintf
  • #1 __vasprintf_chk
  • #2 g_vasprintf
  • #3 g_strdup_vprintf
  • #4 g_logv
  • #5 g_log
  • #6 _folks_individual_aggregator_personas_changed_cb.isra.10
  • #7 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
  • #8 g_closure_invoke
  • #9 signal_emit_unlocked_R
  • #10 g_signal_emit_valist
  • #11 g_signal_emit_by_name
  • #12 _folks_persona_store_emit_personas_changed
  • #13 ___lambda16__gsource_func
  • #14 __edsf_persona_store_idle_process_gsource_func
  • #15 g_main_context_dispatch
  • #16 g_main_context_iterate.isra
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 _vala_main
  • #20 __libc_start_main
  • #21 _start


Top shows the program using over 70% of my system memory, and the process does not appear to finish. It sometimes brings the entire system to a slog or freeze, but appears to not have managed that this time.
Comment 7 Jacob Keller 2016-04-06 21:47:27 UTC
For reference, I took a second trace after a few minutes again.

Thread 1 (Thread 0x7f846369da80 (LWP 8722))

  • #0 vfprintf
  • #1 __vasprintf_chk
  • #2 g_vasprintf
  • #3 g_strdup_vprintf
  • #4 g_logv
  • #5 g_log
  • #6 _folks_individual_aggregator_personas_changed_cb.isra.10
  • #7 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
  • #8 g_closure_invoke
  • #9 signal_emit_unlocked_R
  • #10 g_signal_emit_valist
  • #11 g_signal_emit_by_name
  • #12 _folks_persona_store_emit_personas_changed
  • #13 ___lambda16__gsource_func
  • #14 __edsf_persona_store_idle_process_gsource_func
  • #15 g_main_context_dispatch
  • #16 g_main_context_iterate.isra
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 _vala_main
  • #20 __libc_start_main
  • #21 _start

Hopefully two traces maybe will show where it gets stuck?
Comment 8 Chad Versace 2016-07-14 15:07:48 UTC
Reproduced on 3.20 too (gnome-contacts-3.20.0-1.fc24.x86_64.rpm). In my case, the address book is a CardDAV account on fastmail.com with ~34,000 contacts.
Comment 9 Jacob Keller 2016-07-14 20:28:21 UTC
I also still reproduce this on 3.20 as well. I will once again try to get a back trace when it happens next.
Comment 10 Jacob Keller 2016-07-22 21:32:58 UTC
I've reproduced this using gnome-contacts-3.20.0-1.fc24.x86_64 on Fedora 24. I have a backtrace of every thread here.

Thread 1 (Thread 0x7f846369da80 (LWP 8722))

  • #0 vfprintf
  • #1 __vasprintf_chk
  • #2 g_vasprintf
  • #3 g_strdup_vprintf
  • #4 g_logv
  • #5 g_log
  • #6 _folks_individual_aggregator_personas_changed_cb.isra.10
  • #7 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
  • #8 g_closure_invoke
  • #9 signal_emit_unlocked_R
  • #10 g_signal_emit_valist
  • #11 g_signal_emit_by_name
  • #12 _folks_persona_store_emit_personas_changed
  • #13 ___lambda16__gsource_func
  • #14 __edsf_persona_store_idle_process_gsource_func
  • #15 g_main_context_dispatch
  • #16 g_main_context_iterate.isra
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 _vala_main
  • #20 __libc_start_main
  • #21 _start

Thread 1 (Thread 0x7f846369da80 (LWP 8722))

  • #0 vfprintf
  • #1 __vasprintf_chk
  • #2 g_vasprintf
  • #3 g_strdup_vprintf
  • #4 g_logv
  • #5 g_log
  • #6 _folks_individual_aggregator_personas_changed_cb.isra.10
  • #7 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
  • #8 g_closure_invoke
  • #9 signal_emit_unlocked_R
  • #10 g_signal_emit_valist
  • #11 g_signal_emit_by_name
  • #12 _folks_persona_store_emit_personas_changed
  • #13 ___lambda16__gsource_func
  • #14 __edsf_persona_store_idle_process_gsource_func
  • #15 g_main_context_dispatch
  • #16 g_main_context_iterate.isra
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 _vala_main

Comment 11 David Woodhouse 2017-08-01 15:37:15 UTC
Confirmed (above) in at least 3.20, probably still present in newer versions...
Comment 12 Niels De Graef 2018-01-21 20:23:15 UTC
Hey everyone!

I realize that this is a very annoying problem for you and I did some investigating.

On one hand, this is due to libfolks (the library we use) using a lot of memory. This is not easily fixed in the short term (but will hopefully improve in the long term).

On the other hand, GNOME Contacts has been way too eager in loading and caching some extra information (e.g. to improve filter speeds). Now, I've been doing some work on this code and on my machine, I have some small but noticeable results. Now, is anyone of you willing to try the latest version on git to see if they see any improvement? If so, then I can try to find a bit more spots where to save memory, but if it doesn't matter too much, then the focus should shift to fixing the problem in folks.
Comment 13 Jacob Keller 2018-01-22 16:23:53 UTC
> On the other hand, GNOME Contacts has been way too eager in loading and caching some extra information (e.g. to improve filter speeds). Now, I've been doing some work on this code and on my machine, I have some small but noticeable results. Now, is anyone of you willing to try the latest version on git to see if they see any improvement? If so, then I can try to find a bit more spots where to save memory, but if it doesn't matter too much, then the focus should shift to fixing the problem in folks.

Thank you for digging into this! It's been a while since I've seen a complete system lockup like before, and it was not easily reproducible.

> On one hand, this is due to libfolks (the library we use) using a lot of memory. This is not easily fixed in the short term (but will hopefully improve in the long term).

I agree that it's likely in the libfolks code. In some sense, it may not be possible to "fix" because in Chad Versace's example of 34000 accounts is simply a lot of accounts. That's also true of the active directory setup I have here as well.

I will note that it has been a bit since I've seen the issue. Partly this is due to change in work habbit (I had to work remotely from a laptop for some time, and have been remote shell into the system, so I'm not running the graphical stack as often).
Comment 14 David Woodhouse 2018-01-22 16:40:56 UTC
34,000 accounts isn't a lot.

$ sqlite3 contacts.db 'select count(*) from folder_id;'
454660

In Intel we had a similar order of magnitude.
Comment 15 GNOME Infrastructure Team 2018-01-24 15:15:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-contacts/issues/62.