why does contactsd eat up so much CPU?

asked 2014-07-23 05:23:25 +0200

droll gravatar image

I notice this happening when I open the People app after a long period of time (hours - not sure how many as I have not tracked this objectively) of not having it running.

contactsd - according to Lighthouse - will chew up high CPU load and cause the phone to become slow. UI becomes jerky. looking at dbus, I see a lot of calls to

org.nemomobile.contacts.sqlite.np; member=contactsPresenceChanged org.nemomobile.contacts.sqlite; member=syncContactsChanged org.nemomobile.contacts.sqlite.np; member=contactsChanged

a quick peek and it looked like it was going through all my contacts (I didn't objectively track this against all my contacts but a quick eyeball session looked like it was doing this).

after a while CPU utilization goes back to normal and the phone is fine.

if I put the phone in flight mode while contactsd is doing this, the CPU load drops back to normal. the moment I reconnect again, CPU load goes back up.

edit retag flag offensive close delete

Comments

1

contactsd handles two things:

1) presence changes reported from various XMPP or other IM chat connectors (via Telepathy). Presence changes will occur when the remote contact changes their availability (eg to away or to offline), or when the local device gains or loses connectivity (in which case the entire roster will become available or become unavailable).

2) change notifications from the contacts backend, which will trigger two-way synchronization for any enabled two-way sync profiles (for example, Google and Exchange).

Note that when you open the People application, a delta synchronization is usually performed with your accounts, to detect changes server-side. If any changes have occurred, they are synchronized to the local device.

The combination of these two pieces of functionality is probably what causes the high CPU usage you're reporting. In the next update, the performance of the database has been greatly improved, so this should be less problematic.

chris.adams ( 2014-07-29 04:09:34 +0200 )edit

aaaah, yes, I kinda guessed it was doing that. what I didn't expect was for it to eat up so much CPU usage.

would it be possible to change the way synchronization works so that it is not triggered by launching the People app? that may chew up valuable data usage. perhaps a manual synchronization menu option in the People app? or in settings -> applications -> people: you allow users to choose automatic or manual and if it is manual then the pulley menu in the people app will have an enabled option to "Synchronize Contacts"?

droll ( 2014-07-29 19:12:56 +0200 )edit