akvo / akvo-flow-mobile

Akvo Flow app
GNU General Public License v3.0
18 stars 16 forks source link

investigate OutOfMemoryError in clusters of datapoints map #726

Closed valllllll2000 closed 4 years ago

valllllll2000 commented 7 years ago

https://sentry.io/akvo-foundation/flow-android/issues/264174508/

RuntimeException: An error occured while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:299)
    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
...
(3 additional frame(s) were not displayed)

OutOfMemoryError: None
    at com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm.getClusters(NonHierarchicalDistanceBasedAlgorithm.java:136)
    at com.google.maps.android.clustering.algo.PreCachingAlgorithmDecorator.getClustersInternal(PreCachingAlgorithmDecorator.java:98)
    at com.google.maps.android.clustering.algo.PreCachingAlgorithmDecorator.getClusters(PreCachingAlgorithmDecorator.java:72)
    at com.google.maps.android.clustering.ClusterManager$ClusterTask.doInBackground(ClusterManager.java:213)
    at com.google.maps.android.clustering.ClusterManager$ClusterTask.doInBackground(ClusterManager.java:208)
...
(9 additional frame(s) were not displayed)

An error occured while executing doInBackground()
valllllll2000 commented 7 years ago

Ran analysis on both new and refactored code on my nexus 6 (quite powerful device)

Also ran analisis on sony experia, a very old entry level device. Even with 300 datapoints after rotating the device multiple times, the app crashes:

05-23 13:23:58.654 3596-4635/org.akvo.flow E/AndroidRuntime: FATAL EXCEPTION: GLThread 867
                                                             java.lang.OutOfMemoryError: bitmap size exceeds VM budget
                                                                 at android.graphics.Bitmap.nativeCreate(Native Method)
                                                                 at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
                                                                 at maps.Y.i.a(Unknown Source)
                                                                 at maps.Y.l.a(Unknown Source)
                                                                 at maps.Y.l.a(Unknown Source)
                                                                 at maps.Y.l.b(Unknown Source)
                                                                 at maps.aa.o.a(Unknown Source)
                                                                 at maps.aa.t.a(Unknown Source)
                                                                 at maps.V.K.a(Unknown Source)
                                                                 at maps.V.H.a(Unknown Source)
                                                                 at maps.V.H.b(Unknown Source)
                                                                 at maps.V.x$g.g(Unknown Source)
                                                                 at maps.V.x$g.run(Unknown Source)
05-23 13:24:00.365 3596-3708/org.akvo.flow E/dalvikvm-heap: Out of memory on a 226844-byte allocation.
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.