Repository navigation
fix(replay): Skip the screenshot or frame when its bitmap can't be allocated (JAVA-552) - #6678
Draft
runningcode wants to merge 1 commit into
Draft
runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
This was referenced Nov 19, 2026
📲 Install BuildsAndroid
|
…located A bitmap of the whole window, recording or SurfaceView is one large allocation, which can fail with an OutOfMemoryError while the rest of the heap is healthy. The SDK now catches it only around its own Bitmap allocations and skips that screenshot or frame, instead of crashing the app. This matters for hybrid SDKs, which call ScreenshotUtils on the UI thread without a catch of their own. The frame observer's copy of a replay frame, made with Bitmap.copy or BitmapFactory.decodeFile, is skipped the same way. The frame is still recorded. The screenshot and replay capture catches around these allocations also call ExceptionUtils.rethrowIfFatal now, with a comment saying why they are broad. Refs #5513 Refs JAVA-552 Co-Authored-By: Claude Opus 5.5 <[email protected]>
runningcode
force-pushed
the
no/java-552-bitmap-oom
branch
from
November 19, 2026 09:37
320ded7 to
730480f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
A bitmap of a whole window, frame or SurfaceView is one large allocation, which can fail with an
OutOfMemoryErrorwhile the rest of the heap is healthy. The SDK now catchesOutOfMemoryErroronly around its own single large bitmap allocations, and skips that screenshot or frame instead of crashing the app.Exceptions:
rethrowIfFatalhere instead of in fix: Rethrow fatal errors at the SDK's boundary catches (JAVA-552) #6665, because without the innerOutOfMemoryErrorcatch,rethrowIfFatalwould turn one failed allocation into a crash.OutOfMemoryErrorfrom starting a thread, such as aHandlerThreador a timer, is deliberately left uncaught.💡 Motivation and Context
This is part of the
catch (Throwable)audit. It's independent of the other JAVA-552 PRs, so it can merge in any order.💚 How did you test it?
No new tests, only the existing ones.
📝 Checklist
sendDefaultPIIis enabled.#skip-changelog
🤖 Generated with Claude Code