Closed Bug 1628291 Opened 5 years ago Closed 5 years ago

GeckoDisplay$ScreenshotBuilder: OutOfMemoryError

Categories

(GeckoView :: General, defect, P1)

Unspecified
All
defect

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: sebastian, Assigned: owlish)

Details

(Whiteboard: [geckoview:m77])

Attachments

(1 file)

Saw this crash in a Fennec migration build. Should we catch this internally and handle this situation more gracefully?

https://sentry.prod.mozaws.net/share/issue/730ec39484594d9da438153e7bd86fe6/

java.lang.OutOfMemoryError: Failed to allocate a 6791052 byte allocation with 4194304 free bytes and 4MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java)
    at android.graphics.Bitmap.nativeCreate(Bitmap.java)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:1070)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:1040)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:1007)
    at org.mozilla.geckoview.GeckoDisplay$ScreenshotBuilder.capture(GeckoDisplay.java:21)
    at org.mozilla.geckoview.GeckoDisplay.capturePixels(GeckoDisplay.java:1)
    at org.mozilla.geckoview.GeckoView$Display.capturePixels(GeckoView.java:3)
    at org.mozilla.geckoview.GeckoView.capturePixels(GeckoView.java:1)
    at mozilla.components.browser.engine.gecko.GeckoEngineView.captureThumbnail(GeckoEngineView.kt:3)
    at org.mozilla.fenix.browser.BrowserAnimator$captureEngineViewAndDrawStatically$$inlined$let$lambda$1.invokeSuspend(BrowserAnimator.kt:9)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
    at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:18)
    at kotlin.jvm.internal.Intrinsics.startCoroutineCancellable(Intrinsics.java:1)
    at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:15)
    at kotlin.jvm.internal.Intrinsics.launch(Intrinsics.java:6)
    at kotlin.jvm.internal.Intrinsics.launch$default(Intrinsics.java:2)
    at org.mozilla.fenix.browser.BrowserAnimator.captureEngineViewAndDrawStatically(BrowserAnimator.kt:2)
    at org.mozilla.fenix.components.toolbar.BrowserToolbarView$$special$$inlined$with$lambda$1.invoke(BrowserToolbarView.kt:7)
    at -$$LambdaGroup$js$rSoSXqyxpjwo3DM2X62KxPNCfB8.onClick(java-style lambda group:257)
    at android.view.View.performClick(View.java:5646)
    at android.view.View$PerformClick.run(View.java:22473)
    at android.os.Handler.handleCallback(Handler.java:761)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:156)
    at android.app.ActivityThread.main(ActivityThread.java:6523)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

Well ScreenshotBuilder#capture() returns a GeckoResult<Bitmap>, so I think it's reasonable to expect us to catch exceptions and fail the GeckoResult accordingly. So a-c is welcome to add more checks, but I think we have some work to do here as well.

Priority: -- → P1
Whiteboard: [geckoview:m77]
Assignee: nobody → bugzeeeeee
Pushed by jwillcox@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef583ae0da82 Catch exceptions when trying to create a Bitmap r=snorp
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: