> On Aug 19, 2014, at 10:14 AM, Frederic Yesid Peña Sánchez 
> <[email protected]> wrote:
> 
> 1. We are attempting a "pre-loading" of views, so the user logs-in, the app 
> syncs all data and query all the default views (may be not to pretty, but 
> allows to improve speed on the entire app).
> ¿Is there a way to "clean" memory after each query?. We are receaving a lot 
> of memory warnings

Sounds like you're issuing queries that return a lot of data. If all you want 
to do is update the view's index, and you don't need the query results, you can 
just use a query with limit=1 so that almost no data will be returned.

> 2. When we sync the first time, an iPad mini (first gen)  goes up in memory 
> towards 240 MB before the app is being killed by "memory pressure", but this 
> does not happen with iPad Mini Retina or iPad 3rd+ Gen (65MB top).

Syncing itself doesn't use a lot of memory. But if you have live queries 
active, they'll keep triggering over and over during the initial sync as the 
pull replicator adds documents. And if these queries are returning a large 
number of rows, memory usage could get high.

It'd be best to limit the number of rows to something reasonable. If you're 
driving a table view that can only show maybe 20 rows, you don't need to 
populate it with all 10,000 rows, for example. This does get more complex to 
code since you have to use paging.

Another option is to not create the live queries on the first launch until the 
initial sync has completed.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/30F4880B-8543-4851-8FE7-AFF8329FD2BE%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to