Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

FP4: Apps crash with AndroidRuntime out of Memory ( java.lang.OutOfMemoryError)

  • /e/ version: v0.21
  • Device model(s): FP4
  • Device rooted: no

Summary

Some apps keep crashing at startup (eg. OsmAnd, Synology Photos), other apps crash after interaction (Signal when sending Videos, Aegis when restoring a backup).

The problem

Multiple apps cannot run on a new FP4 with /e/.

  • Fresh install of /e/ on a Fairphone FP4
  • Install OsmAnd (4.1.11) from Fdroid
  • Start OsmAnd

What is the current behavior?

App crashes 10 secs after startup.

What is the expected correct behavior?

App keeps running :-)

Technical informations

Relevant logs (adb logcat)

01-17 09:27:09.501 20067 20083 I net.osmand.plu: Clamp target GC heap from 41MB to 36MB
01-17 09:27:09.501 20067 20083 I net.osmand.plu: Alloc concurrent copying GC freed 3561(219KB) AllocSpace objects, 2(44KB) LOS objects, 0% free, 35MB/36MB, paused 26us total 132.838ms
01-17 09:27:09.501 20067 20081 I net.osmand.plu: WaitForGcToComplete blocked Background on HeapTrim for 605.764ms
01-17 09:27:09.502 20067 20111 I net.osmand.plu: WaitForGcToComplete blocked Alloc on HeapTrim for 894.870ms
01-17 09:27:09.502 20067 20111 I net.osmand.plu: Starting a blocking GC Alloc
01-17 09:27:09.502 20067 20067 I net.osmand.plu: WaitForGcToComplete blocked Alloc on HeapTrim for 606.137ms
01-17 09:27:09.502 20067 20067 I net.osmand.plu: Starting a blocking GC Alloc
01-17 09:27:09.502 20067 20111 E AndroidRuntime: FATAL EXCEPTION: RenderingBaseImage
01-17 09:27:09.502 20067 20111 E AndroidRuntime: Process: net.osmand.plus, PID: 20067
01-17 09:27:09.502 20067 20111 E AndroidRuntime: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available
01-17 09:27:09.502 20067 20080 I net.osmand.plu: WaitForGcToComplete blocked Alloc on HeapTrim for 613.274ms
01-17 09:27:09.502 20067 20080 I net.osmand.plu: Starting a blocking GC Alloc
01-17 09:27:09.504 20067 20093 I net.osmand.plu: WaitForGcToComplete blocked Alloc on HeapTrim for 171.459ms
01-17 09:27:09.504 20067 20093 I net.osmand.plu: Starting a blocking GC Alloc
01-17 09:27:09.505 20067 20117 I net.osmand.plu: WaitForGcToComplete blocked Alloc on HeapTrim for 175.748ms
01-17 09:27:09.505 20067 20117 I net.osmand.plu: Starting a blocking GC Alloc
01-17 09:27:09.505 20067 20117 E AndroidRuntime: FATAL EXCEPTION: Initializing app
01-17 09:27:09.505 20067 20117 E AndroidRuntime: Process: net.osmand.plus, PID: 20067
01-17 09:27:09.505 20067 20117 E AndroidRuntime: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available

Adb output for dalvik.vm.heapsize (as instructed by user tcecyk):

❯ adb shell getprop | grep -P 'dalvik.*(heap|dex)'
[dalvik.vm.dex2oat-Xms]: [64m]
[dalvik.vm.dex2oat-Xmx]: [512m]
[dalvik.vm.dex2oat-max-image-block-size]: [524288]
[dalvik.vm.dex2oat-minidebuginfo]: [true]
[dalvik.vm.dex2oat-resolve-startup-strings]: [true]
[dalvik.vm.dex2oat-updatable-bcp-packages-file]: [/system/etc/updatable-bcp-packages.txt]
[dalvik.vm.dexopt.secondary]: [true]
[dalvik.vm.heapsize]: [36m]
[dalvik.vm.image-dex2oat-Xms]: [64m]
[dalvik.vm.image-dex2oat-Xmx]: [64m]

Solutions

Workaround

Until the new build is out, User tcecyk posted a workaround in the forum: https://community.e.foundation/t/davx5-and-nextcloud-contacts-outofmemoryerror/38151/16 . Please see instructions there. Short version:

adb root
adb shell setprop dalvik.vm.heapsize 512m
adb shell stop
adb shell start

but this will not persist a reboot.

I can confirm, that with this settings applied OsmAnd runs smoothly.

Edited by Webman