On Aug 19, 2014, at 10:14 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> 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
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).
On Aug 19, 2014, at 10:14 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> 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 warningsSounds 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.
On Aug 19, 2014, at 10:54 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> wrote:As i told you, the same app on a iPad Mini Retina ran perfect and under 70M memory consumption…
Does "runAsync" respect "limit=1" ??
On Aug 20, 2014, at 9:35 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> wrote:1. Sync all data (replicator ON)
2. Run al "preload" queries (replicator OFF)
3. Enable replicator again.
This assuming replications with massive queries (100+) would affect concurrency on SQLite backend.
On Aug 20, 2014, at 10:39 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> wrote:Good news (bad for me, my foul), the memory issue was "zombies" enabled in "run" schema.
If i whish to pause and resume replication, which would be the correct approach?
I've tried "_myPull.continuous=NO;" but the logs shows errors like: