Lawnchair: java.lang.OutOfMemoryError when lawnchair starts up

Created on 10 Oct 2017  路  5Comments  路  Source: LawnchairLauncher/lawnchair

Description

I use IFTTT to download latest wallpapers from reddit.com/r/wallpapers (Specifically, this recipe: https://ifttt.com/applets/33984870d-set-my-android-wallpaper-to-the-best-posts-in-r-wallpapers )

Today it seems a wallpaper was downloaded that was quite big, lawnchair crashed.
The wallpaper in question is this one I think: https://i.imgur.com/p2UBn6y.jpg (quite wide).

Expected Behavior

It doesn't crash. :-)

Actual Behavior

Lawnchair crashed

Steps to Reproduce

  1. Update phone homescreen wallpaper but not using standard wallpaper chooser (Like IFTTT recipe mentioned above) (I attempted to set the wallpaper using adb, but my adb-fu failed me...)
  2. Crash

What seems to happen is that IFTTT simply sets the wallpaper, whereas the standard wallpaper chooser does some sanity checking on the wallpaper first.

Environment

  • Device: Samsung Galaxy S7 Edge SM-935F
  • Android version: 7.0
  • Launcher version: 1.0.1063
  • Rom: Stock Rom

Logcat

10-10 10:52:00.586 29812 29863 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-3
10-10 10:52:00.586 29812 29863 E AndroidRuntime: Process: ch.deletescape.lawnchair, PID: 29812
10-10 10:52:00.586 29812 29863 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 139806732 byte allocation with 16777216 free bytes and 86MB until OOM
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at android.graphics.Bitmap.nativeCreate(Native Method)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at android.graphics.Bitmap.createBitmap(Bitmap.java:977)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at android.graphics.Bitmap.createBitmap(Bitmap.java:948)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at android.graphics.Bitmap.createBitmap(Bitmap.java:915)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at ch.deletescape.lawnchair.blur.BlurWallpaperProvider.blur(Unknown Source)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at ch.deletescape.lawnchair.blur.BlurWallpaperProvider.updateWallpaper(Unknown Source)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at ch.deletescape.lawnchair.blur.BlurWallpaperProvider.access$updateWallpaper(Unknown Source)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at ch.deletescape.lawnchair.blur.BlurWallpaperProvider$mUpdateRunnable$1.run(Unknown Source)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
10-10 10:52:00.586 29812 29863 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:762)

bug help wanted

Most helpful comment

Finally fixed with commit 678144787d9dd47e94fd6b6f50719f27cf4022c3

All 5 comments

Your issue seems to be related to blur, more specifically, blurring the wallpaper (for e.g. the dock).

Since Android stores the original image and allows one to access it, Lawnchair uses that instead of capturing the current screen and blurring the capture. This means that a set wallpaper's original will be used for blurring, which is indeed quite large (6MP), which causes a memory overflow.

A temporary fix would be switching to a different launcher, or resetting your wallpaper, or resetting Lawnchair so it does not use blur while you change wallpaper.

@deletescape I believe there should be an exception catch at ch.deletescape.lawnchair.blur.BlurWallpaperProvider's blur method so such issues in the future are caught.

Yeah I simply changed the wallpaper using another launcher and it all worked fine after that. Was unable to get to the Lanwchair settings to switch off blur, as I figured it was something to do with blur after finally getting to the stacktrace.

@AubreyKilian you could've gotten to Settings and wipe Lawnchair's settings :) Either way, we'll look into this.

Heh, I didn't want to have to reposition all my homescreen icons etc. :-P

Finally fixed with commit 678144787d9dd47e94fd6b6f50719f27cf4022c3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SlowNicoFish picture SlowNicoFish  路  3Comments

tstackhouse picture tstackhouse  路  6Comments

ohayoubaka picture ohayoubaka  路  4Comments

adamjmtz picture adamjmtz  路  5Comments

AxiK101 picture AxiK101  路  5Comments