Skip to content

Worklets Legacy Eval Mode memory consumption regression in production #9650

Description

@SirJalias

Description

On React Native 0.85.3 (New Architecture, Hermes V1), simply importing react-native-reanimated — without rendering a single animated component or calling any of its APIs — increases native RAM usage by ~25–30% compared to RN 0.83.x. Removing the import alone restores the baseline memory profile.

This was originally filed as a React Native memory regression and then investigated as a Hermes V1 regression, but the evidence in both threads points back to Reanimated as the trigger. Filing here so the Reanimated team has visibility.

Cross-references

if you simply remove reanimated import you will see normal baseline for rn app
however just import of reanimated without any usage of it cause this problem
I know we can't go without reanimated but from my point of view this is not hermes v1 problem

Environment

react-native 0.85.3
react-native-reanimated 4.4.0
react-native-worklets 0.9.1
react 19.2.3
Architecture New Architecture (Fabric + TurboModules)
JS engine Hermes V1 (bytecode compiled)
Platform Android
Device Pixel 9 Pro, Android 16
Build Release / production build

Previously-working baseline: react-native 0.83.9 (Hermes < V1).

Observed memory (production build, measured with Flashlight)

Phase RN 0.83.9 RN 0.85.3 Delta
Startup RAM ~370 MB ~480 MB +110 MB
End-state RAM ~560 MB ~720 MB +160 MB

Heap inspection on Hermes V1 shows most of the extra allocation coming from repeated 256 KB blocks originating in Hermes — which only appear once Reanimated is in the bundle.

Image

Why we believe this is on the Reanimated side

  • The RN-only and Hermes-only investigations both reproduce the regression, but the variable that flips it on/off is the Reanimated import, not app code or animation usage.
  • The Hermes maintainers' thread (Cant find variable _setGlobalConsole_f with expo #2048) concludes Hermes V1 is expected to use less RAM, and the reporter narrowed the trigger to the Reanimated import.
  • Removing the import — with everything else (RN 0.85.3, Hermes V1, New Arch) unchanged — restores the baseline.

Steps to reproduce

  1. App on RN 0.83.9 — build a release APK, run a standardized UI flow (FlashList scrolling, screen navigation, repeated interactions) via Maestro, profile RAM with Flashlight. Record baseline.
  2. Upgrade to RN 0.85.3 (Hermes V1, New Architecture) with no application code changes. Repeat the same flow → ~25–30% higher RAM.
  3. Isolation step: in the 0.85.3 build, remove the import 'react-native-reanimated' (and any reanimated imports) without otherwise changing the app. → Memory returns to the 0.83.x baseline.

The key signal is step 3: the regression is present from the mere presence of the import, before any animation is mounted or any worklet runs.

Snack or a link to a repository

https://github.com/SirJalias/AwesomeProject

Reanimated version

4.4.0

Worklets version

0.9.1

React Native version

0.85.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native CLI

Architecture

New Architecture (Fabric renderer)

Reanimated feature flags

None

React Native release level

Stable

Build type

Debug app & production bundle

Device

Real device

Host machine

macOS

Device model

Pixel 9 Pro, Android 16

Acknowledgements

Yes

Metadata

Metadata

Labels

Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is provided

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions