android mapview app runs into memory issues (Grow Heap): Help choose design AsyncTask or IntentService or Service? -
android mapview app runs into memory issues (Grow Heap): Help choose design AsyncTask or IntentService or Service? -
i've mapview needs display plenty of overlay network. current design using asynctask in socket connection open in doinbackground() , in publishprogress() displays overlay on mapview.
now problem design is:
first there overlays (itemizedoverlays<overlayitem>) 100 or allocates memory during info processed. next overlay map tiles has load, in run in memory problems of grow heap (frag case) has load bitmaps (although i'm using asynctask load , display in parallel executor). the panning , zooming take long time there overlays displayed , same time map tiles has loaded. , anr dialog pops up. now socket connection has open of time (say 30mins) i'm not sure @ time new info received, meaning asynctask has running in background of time. now plan move asynctask class intentservice class socket connection can open of time, how create communicate fragmentactivity? before moving that, create sense move intentserviceor service @ asynctask class i'm using?
note: reason want move intentservice or service i'm running memory issues, , of them allocated memory bitmap (maptiles). tried cleaning maptile cache well, not much luck. tried calling system.gc() in timer thread extent seems working, long term not sure how perform.
edit: bottom line gc causing app slow down. please have @ link, how i'm loading maptiles: optimize android code snippet - improve design approach? heads up, maptiles loading quite fast , when no overlays there. when info received through network, , tried overlay on it, gc triggers multiple times.
based on comments sounds gc causing app slow down. how instead of recycling bitmaps, reuse them.
android android-asynctask osmdroid android-memory android-intentservice
Comments
Post a Comment