Android app keeps crashing during review with OutOfMemoryError

Since upgrading to 1.52, the Android app crashes a lot during review, after reviewing about 30 to 50 photos. With some older version there were already similar crashes, but not that often (maybe every 200 pictures).

These crashes make it really frustrating to review any larger amount of pictures. Also after each crash I have to find the position in the sequence again, because there is no marker for already-reviewed pictures.

In addition, some time ago when I upgraded there were some unreviewed pictures left which were gone after the upgrade. So even upgrading to a newer version which fixes such problems is dangerous if I already have pictures for review.

So I’m putting off further photographing until there are newer versions of the app which are reported to work better and which are reported to have such issues fixed. I really don’t want to spend my weekend evenings being frustrated about experimental tech.

This is on a Samsung Galaxy S4 mini, with Android 4.4.2.
Here are some crash infos from system log:

11-15 19:15:14.430 D/dalvikvm(24933): GC_FOR_ALLOC freed 287K, 11% free 231144K/259112K, paused 39ms, total 40ms
11-15 19:15:14.430 I/dalvikvm-heap(24933): Forcing collection of SoftReferences for 3995152-byte allocation
11-15 19:15:14.490 D/dalvikvm(24933): GC_BEFORE_OOM freed 15K, 11% free 231129K/259112K, paused 59ms, total 59ms
11-15 19:15:14.490 E/dalvikvm-heap(24933): Out of memory on a 3995152-byte allocation.
11-15 19:15:14.490 I/dalvikvm(24933): "AsyncTask #3" prio=5 tid=20 RUNNABLE
11-15 19:15:14.490 I/dalvikvm(24933):   | group="main" sCount=0 dsCount=0 obj=0x457644e0 self=0x63bdd5d8
11-15 19:15:14.490 I/dalvikvm(24933):   | sysTid=25074 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1672695432
11-15 19:15:14.490 I/dalvikvm(24933):   | state=R schedstat=( 0 0 0 ) utm=404 stm=44 core=1
11-15 19:15:14.490 I/dalvikvm(24933):   at android.graphics.BitmapRegionDecoder.nativeDecodeRegion(Native Method)
11-15 19:15:14.490 I/dalvikvm(24933):   at android.graphics.BitmapRegionDecoder.decodeRegion(BitmapRegionDecoder.java:373)
11-15 19:15:14.490 I/dalvikvm(24933):   at com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder.decodeRegion(SkiaImageRegionDecoder.java:75)
11-15 19:15:14.490 I/dalvikvm(24933):   at com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$TileLoadTask.doInBackground(SubsamplingScaleImageView.java:1485)
11-15 19:15:14.490 I/dalvikvm(24933):   at com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$TileLoadTask.doInBackground(SubsamplingScaleImageView.java:1459)
11-15 19:15:14.490 I/dalvikvm(24933):   at android.os.AsyncTask$2.call(AsyncTask.java:288)
11-15 19:15:14.490 I/dalvikvm(24933):   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-15 19:15:14.490 I/dalvikvm(24933):   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
11-15 19:15:14.490 I/dalvikvm(24933):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-15 19:15:14.490 I/dalvikvm(24933):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-15 19:15:14.490 I/dalvikvm(24933):   at java.lang.Thread.run(Thread.java:841)
11-15 19:15:14.490 I/dalvikvm(24933): 
11-15 19:15:14.490 D/skia    (24933): --- decoder->decodeRegion returned false
11-15 19:15:14.500 D/Sensors (696): LightSensor readEvents x = 105.000000, raw = 105
11-15 19:15:14.500 W/dalvikvm(24933): threadid=20: thread exiting with uncaught exception (group=0x418fdda0)
11-15 19:15:14.500 E/AndroidRuntime(24933): FATAL EXCEPTION: AsyncTask #3
11-15 19:15:14.500 E/AndroidRuntime(24933): Process: app.mapillary, PID: 24933
11-15 19:15:14.500 E/AndroidRuntime(24933): java.lang.RuntimeException: An error occured while executing doInBackground()
11-15 19:15:14.500 E/AndroidRuntime(24933):     at android.os.AsyncTask$3.done(AsyncTask.java:300)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.lang.Thread.run(Thread.java:841)
11-15 19:15:14.500 E/AndroidRuntime(24933): Caused by: java.lang.OutOfMemoryError
11-15 19:15:14.500 E/AndroidRuntime(24933):     at android.graphics.BitmapRegionDecoder.nativeDecodeRegion(Native Method)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at android.graphics.BitmapRegionDecoder.decodeRegion(BitmapRegionDecoder.java:373)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder.decodeRegion(SkiaImageRegionDecoder.java:75)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$TileLoadTask.doInBackground(SubsamplingScaleImageView.java:1485)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$TileLoadTask.doInBackground(SubsamplingScaleImageView.java:1459)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
11-15 19:15:14.500 E/AndroidRuntime(24933):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-15 19:15:14.500 E/AndroidRuntime(24933):     ... 4 more
11-15 19:15:14.510 W/ActivityManager(696):   Force finishing activity app.mapillary/.android.activity.ReviewImageActivity

Hi @roadblock,

We are trying to avoid issue reporting in the forum. Do you think you could email this to us instead (hello@mapillary.com) or file an issue on Github? Start here - short guide to get started!

Many thanks!
Sandra

Hi Sandra, I will look into this on the weekend.

The crash info is now also written at https://github.com/mapillary/mapillary_issues/issues/1555 . But that bug report is not public because the site thinks I’m a bot. I have contacted Github about this, so maybe they will unlock the bug report and then you can see it.

Thanks! We will have a look and get back to you.

@roadblock, do you have the app configured to NOT generate thumbnails? I changed that setting on mine a few weeks ago and started running in to no end of trouble. I’ve reenabled it, and the app seems to be running smoother now (but I’ve also updated to the latest version, which might also be a factor).

It’s hard to do this right. For thumbnails, we are pre generating them when shooting so we save time later. For individual image review, we load the full image so you can zoom and pan, and with hundreds of swipes on some phones you get out of memory. Maybe we should add another setting to even use thumbnails in individual review?

Now, are things running smoother now with the latest updates?

We have been making the processing a bit smoother and working on memory problems during review.

/peter

Yes, it is much better. Now I can delete bad pictures.