incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Becky Gibson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-828) iOS contact.save() stucks the UI from updating on heavy load & has memory leaks.
Date Mon, 20 Aug 2012 21:17:38 GMT

    [ https://issues.apache.org/jira/browse/CB-828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438218#comment-13438218
] 

Becky Gibson commented on CB-828:
---------------------------------

I did an implementation of search and save using basic blocks.  Seems to help when doing multiple
saves.  Hard to tell on search since that is fast anyways.  We are somewhat limited in the
amount of threading since we have to gaurantee access to ABAddressBookRef occurs in the same
thread - that will make search using multithreads more complicated.  Please take a look at
https://github.com/becka11y/incubator-cordova-ios/tree/contactsGCD

                
> iOS contact.save() stucks the UI from updating on heavy load & has memory leaks.
> --------------------------------------------------------------------------------
>
>                 Key: CB-828
>                 URL: https://issues.apache.org/jira/browse/CB-828
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Olivier Louvignes
>            Assignee: Shazron Abdullah
>              Labels: contacts
>             Fix For: 2.1.0
>
>
> I'm trying to restore 3000 contacts on a device, since i need to display a progress UI,
I had to use something like this (SenchaTouch 2 code but you get the point).
> [CODE]
> //forEach contacts as contact...
> _.delay(function() {
> 				contact.save({callback : function(contact, operation) {
> 					d&&console.log(displayName + ' ~ saved ('+ action +') contact', arguments);
> 					j++;
> 					App.getViewport().mask({message: __('restore...'), details: j + '/' + count, progress:
j/count, mode: 'determinate'});
> 					// Last item ?
> 					if(j == count) {
> 						contactStore.clearFilter();
> 						return self.afterRestore(callback);
> 					}
> 				}});
> 			}, 25*i);
> [/CODE]
> Works quite well in the simulator but i'm getting regular "failed to return after waiting
10 seconds. main run loop mode: kCFRunLoopDefaultMode" on a device.
> Major issue is that UI gets stuck for minutes.
> Then i get a few "Received memory warning."
> As if somehow the memory stacked somewhere (but the whole point of making separate call
was to avoid memory breakdown), so there might be a leak.
> At the end, it sometimes work / crash.
> Would there be a way to somehow use another thread for theses AddressBook operations?
> How could i prevent theses memory leaks?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message