fix(android): reduce polyline update churn causing OOM#88
Merged
Conversation
Fixes CONSUMER-APP-44Y
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.
Summary
Fixes CONSUMER-APP-44Y — fatal
OutOfMemoryErroratsyncPolylineView/PolylineAnimator.update(19 events, 15 users). Trivial allocations fail with the 256MB heap exhausted; the polyline sync path is the hottest allocator, hammered by redundant Binder transactions into the GMS renderer:setWidth/setZIndexfired on every React commit even when unchanged (Polyline.setWidthis the literal crash frame)poly.colorset on every animation frame===), but Fabric delivers new list instances per commit — content-equal coordinates re-parceled the full route and re-applied up to 512 gradient spansChanges:
MIN_UPDATE_INTERVAL_NANOS)strokeWidth/zIndexintoPolylineAnimatorwith change-guardspoly.colorin the single-color path (gradient path keeps the unconditional set — it clears stale spans, see fix(android): clear stale spans before setting polyline points #67)coordinates/strokeColorsdirty-checksPer-frame cost drops from 3–4 Binder transactions @120hz to 1 (
setPoints) @≤60Hz for the common solid-color animated route. Companion consumer-app fix gates the live-tracking trailing-position updates that drove commits 5×/s.Type of Change
Test Plan
3.2.18+763) to beta.15–17 sources to confirm all prior OOM fixes (fix(android): cap gradient spans to prevent OOM on long polylines #66, fix(android): clear stale spans before setting polyline points #67, fix(android): oom crash in PolylineAnimator from redundant span allocations #69, fix(android): clean up polyline animator on view drop #72) were already present in crashing buildsScreenshots / Videos
N/A
Checklist
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.