biddyweb / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
2 stars 1 forks source link

Large device contact list kills the service #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Populate the address book with a few hundreds of contacts. It is hard to say 
what number is needed for each device but on my Nexus S 500 contacts were 
definitely enough. 
2. Start the RCS service
3. Watch the service to do 500 OPTIONS requests and then be killed by OS at the 
very end of it

What is the expected output? What do you see instead?

The service should survive the initial sync even for a large address book

What version of the product are you using? On what operating system?

current trunk

Please provide any additional information below.

I used the attached script to populate the dummy contacts and then "Contact 
Remover" free app to get rid of them.

From what I see, it seems to me that at the end of processing the system spends 
lots of time in ContactsManager.cleanRCSEntries(). This method loops over the 
contacts and updates them. I believe this work should be offloaded to a 
separate thread to avoid holding the main thread (look at traces.txt attached). 
I believe that causes the eventual ANR.

It would be also a good idea to somehow slow down the initial synchronization 
process. Although I believe right now the process is sequential, it still 
causes a significant load on the system in case of large number of contacts, 
the GC works very hard etc. I would even recommend to make it manual, i.e. give 
an application using the service an opportunity to initiate the initial sync 
process, possibly monitor its progress and be notified about its completion. In 
this case the app could potentially display some kind of progress bar 
indicating that the heavy one-time sync operation is in progress.

Original issue reported on code.google.com by ngrigor...@gmail.com on 28 May 2012 at 7:16

Attachments:

GoogleCodeExporter commented 9 years ago
I have a fix that at least allows the service to survive the initial step. It 
does not address the "aggressiveness" :) of the initial sync. I have just 
tested it with the same set of 500 test contacts and it seems to be working 
fine.

Original comment by ngrigor...@gmail.com on 29 May 2012 at 3:56

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks to this contribution. We will integrate it in the next sprint.

Original comment by jmauffret@gmail.com on 30 Jul 2012 at 7:36

GoogleCodeExporter commented 9 years ago
Your fix has been added. Thks for your contribution.

Original comment by jmauffret@gmail.com on 17 Sep 2012 at 1:25