Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of Memory crash #16

Open
kklyoon opened this issue Jan 16, 2020 · 1 comment
Open

Out of Memory crash #16

kklyoon opened this issue Jan 16, 2020 · 1 comment

Comments

@kklyoon
Copy link

kklyoon commented Jan 16, 2020

When repeat crop

OOM crash shows up

Device : LG G4
Android 6.0

01-17 01:34:39.052 32582-811/com.takusemba.cropmesample E/AndroidRuntime: FATAL EXCEPTION: Thread-211226
    Process: com.takusemba.cropmesample, PID: 32582
    java.lang.OutOfMemoryError: Failed to allocate a 193981996 byte allocation with 18563792 free bytes and 17MB until OOM
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
        at android.graphics.Bitmap.nativeCreate(Native Method)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:831)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:739)
        at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:615)
        at com.takusemba.cropme.CropLayout$crop$1.invoke(CropLayout.kt:188)
        at com.takusemba.cropme.CropLayout$crop$1.invoke(CropLayout.kt:31)
        at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
01-17 01:34:39.778 32582-32582/com.takusemba.cropmesample E/WindowManager: android.view.WindowLeaked: Activity com.takusemba.cropmesample.ui.activities.CropActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{afcc6bc V.E...... R.....I. 0,0-1368,1582} that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:375)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
        at android.app.Dialog.show(Dialog.java:322)
        at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1007)
        at com.takusemba.cropmesample.ui.activities.CropActivity$onCreate$2.onSuccess(CropActivity.kt:58)
        at com.takusemba.cropme.CropLayout$crop$1$1.run(CropLayout.kt:197)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5525)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
01-17 01:34:39.779 32582-32582/com.takusemba.cropmesample E/WindowManager: android.view.WindowLeaked: Activity com.takusemba.cropmesample.ui.activities.CropActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{3961645 V.E...... R.....ID 0,0-1368,0} that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:375)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
        at android.app.Dialog.show(Dialog.java:322)
        at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1007)
        at com.takusemba.cropmesample.ui.activities.CropActivity$onCreate$2.onSuccess(CropActivity.kt:58)
        at com.takusemba.cropme.CropLayout$crop$1$1.run(CropLayout.kt:197)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5525)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
@kklyoon
Copy link
Author

kklyoon commented Jan 26, 2020

I resolved this crash by using Glide Bitmaptransform. will you try? or will I make PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant