napp.alloy.adapter.restapi icon indicating copy to clipboard operation
napp.alloy.adapter.restapi copied to clipboard

FYI: fetch, 'add: true' and garbage collection

Open monotv opened this issue 10 years ago • 2 comments

I had a log full of DEBUG/dalvikvm(509): GC_CONCURRENT freed 4688K, 23% free 18428K/23751K, paused 7ms+19ms when executing the callback of the apiCall method. Sometimes the app crashed, sometimes it would just take some time until it was useable again.

I called fetch with add: true to just append incoming results to my table. When I set it to false there was no GC issue. After a while of researching I combined it with silent: true and my issue was solved.

I don't know if this is a restapi.js issue, how I use restapi.js or an issue of the Backbone version of Titanium or maybe a combination of them all. But maybe my solution might help others who face the same problem and come here for help.

Nexus 4 Titanium 3.3.0 Alloy 1.4.1 Rest API Adapter for Titanium Alloy 1.1.5

monotv avatar Sep 03 '14 14:09 monotv

it depends.. if you call the fetch many times, then it will crash without silent: true, since add just calls the success callback as many times as necessary. Can you please share some code ?

viezel avatar Sep 03 '14 14:09 viezel

Look at #54. May be this patch solve issue

falkolab avatar Dec 02 '14 14:12 falkolab