#4408·paseo

Android app slows down and crashes out of memory during long dictation, long streamed answers, or with many sessions

Author: Lukas-NovakCreated Sep 6, 2026Updated Sep 28, 2026
Labelsbugplatform:androidp1triaged

What's broken

On Android, a single continuous dictation session reliably kills the app after 60–130 seconds of recording. The microphone/audio path is fine — the app dies from native memory exhaustion (Scudo OOM / std::bad_alloc) inside the UI-commit pipeline (Reanimated AnimationFrameQueue → Fabric ShadowTree::commit). Reproduced 4× across 2 days, including on the first dictation of a fresh app process.

Related: #2486 (same symptom area — Android dictation instability — but that hypothesis is audio-resource retention across repeated sessions; the crashes below are a different, proven mechanism and can occur on the first session). Also related: #2485.

Full debuggerd/dropbox records below — hopefully also useful for #2486, which asked for a logcat.

Crash evidence (all: app sh.paseo 0.7.2/v7002, thread mqt_v_js = JS thread)

1) 2026-09-02 18:50 — native SIGABRT:

Abort message: 'Scudo ERROR: internal map failure (error desc=Out of memory)'
scudo::reportMapError -> scudo_malloc -> operator new
 -> facebook::react::YogaLayoutableShadowNode::cloneChildInPlace
 -> ... -> ShadowTree::tryCommit -> ShadowTree::commit
 -> RuntimeScheduler_Modern::performMicrotaskCheckpoint (Hermes)

2) 2026-09-06 10:25 — native crash, thread mqt_v_js:

std::terminate() at libc++_shared.so
 -> libreanimated.so
 -> facebook::react::UIManager::shadowTreeWillCommit
 -> ShadowTree::tryCommit -> ShadowTree::commit (JS task)

3) 2026-09-06 18:48:45 (+0200) — native SIGABRT, process uptime 1823 s:

Abort message: 'Scudo ERROR: internal map failure (error desc=Out of memory)'

4) 2026-09-06 20:27:40 (+0200) — Java crash, process uptime 881 s:

com.facebook.jni.CppException: Exception in HostFunction: java.lang.OutOfMemoryError: std::bad_alloc
  at com.swmansion.reanimated.NativeProxy.performOperations (Native Method)
  at com.swmansion.reanimated.NodesManager.performOperations (NodesManager.java:123)
  at com.swmansion.reanimated.NodesManager.performOperationsRespectingDrawPass (NodesManager.java:142)
  at com.swmansion.reanimated.NativeProxy.maybeFlushUIUpdatesQueue (NativeProxy.java:515)
  at com.swmansion.worklets.runloop.AnimationFrameCallback.onAnimationFrame (Native Method)
  at com.swmansion.worklets.runloop.AnimationFrameQueue.executeQueue (AnimationFrameQueue.java:92)
  at android.view.Choreographer.doFrame ...

Correlated daemon-side telemetry

  • Each crash lands exactly 60–130 s after dictation_stream_start: 08:24 UTC (≈80 s), 16:47 UTC (≈80 s), 18:25:30 UTC (≈132 s), 17:56 UTC (≈60 s).
  • During recording the app streams ~26–31 dictation_stream_chunk msgs/s (base64 PCM in JSON), each individually acked, plus partial transcript updates — while a Reanimated animation loop commits the Fabric tree every vsync.
  • Daemon (0.7.2) stays healthy throughout (no restarts; event loop fine); the stream is finalized server-side even after the client dies.

Hypothesis

Per-frame Reanimated animation (recording indicator/waveform) triggers a Fabric shadow-tree commit every frame; concurrently, ~31 WS msgs/s churn JS/native allocations (audio base64 strings + partials UI updates). Native (Scudo) allocation for Yoga/Fabric nodes grows unboundedly until Scudo aborts / std::bad_alloc. Phone RAM pressure shortens time-to-crash but is not required (first-session crashes included).

Suggested directions

  • Audit the recording-indicator animation: avoid per-frame shadow commits / subtree cloning while streaming; profile node allocations over a 90 s recording.
  • Consider batching (or binary frames) for dictation_stream_chunk + acks to reduce JS-thread churn; ~31 JSON+base64 RTTs per second is a lot of allocation churn.
  • Optionally throttle partial-transcript UI updates during long dictations.

Environment

  • Device: Samsung Galaxy S24 (SM-S921B), Android 16 (BP4A.251205.006), 7.4 GB RAM (≈1.7 GB available at crash time)
  • App: sh.paseo 0.7.2 (versionCode 7002, updated 2026-09-02)
  • Daemon: @getpaseo/server 0.7.2 (Docker), connected via relay relay.paseo.sh
  • STT: local sherpa-onnx parakeet-tdt-0.6b-v3-int8 (daemon-side)