Skip to content

Severe memory regression in V1 #2048

@rodperottoni

Description

@rodperottoni

Original issue: expo/expo#46519

Bug Description

After upgrading to Expo 56 and as a consequence Hermes v1, RAM memory usage almost doubled in my app.
I tried going back to SDK 55 and enabling the V1 Opt-In via Expo's expo-build-properties, and the memory increase is observed there too.

Steps To Reproduce

Minimal reproducible example
https://github.com/rodperottoni/expo-sdk-56-mem-regression

Steps to reproduce
I have provided an example repository with a sandbox for both Expo SDK 56 and 55. The main branch is SDK 56, and the sdk-55 branch is SDK 55.
Checkout to each branch and run npm i --force + npm run compile + npm run ios.
Then, open the performance monitor as soon as the app opens.

Findings

On SDK 56 RAM usage almost doubles in this basic example (149mb -> 266mb):

SDK 55 SDK 56
Image Image

This increase is more noticeable in complex apps. In my employer's production app we've jumped from ~580mb up to 1.1GB in the home page of our app.

Further scenarios I tested:

  • SDK 55 + useHermesV1: true: Increased RAM usage
    • This scenario is in the sdk-55-with-hermes-v1 branch of the example repo
  • SDK 56 + useHermesV1: false: Increased RAM usage (disabling this flag seems to not do anything?)
    • This scenario is in the sdk-56-not-hermes-v1 branch of the example repo

The Expected Behavior

Memory usage to remain the same or decrease. The React Native 0.84 release notes say:

Automatic performance gains: All apps will use Hermes V1 by default, bringing improved execution speed and reduced memory usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    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