hackemate
hackemate

Reputation: 537

How to test the ram memory usage in react native?

I am very new on react native, I am trying to know how to see the memory usage that my app need when I developing, and some tricks to improve this.

Upvotes: 1

Views: 14189

Answers (2)

EdgarT
EdgarT

Reputation: 1088

If you are here in 2022. Use this:

Android Profiler: https://developer.android.com/studio/profile/android-profiler

Android Device Monitor was deprecated since Android Studio 3.1. More info here: https://developer.android.com/studio/profile/monitor

Upvotes: 4

haMzox
haMzox

Reputation: 2109

For Android, I hope this helps

adb shell dumpsys meminfo

But this is not human friendly, very difficult to understand.

You can also try.

Android Device Monitor, if you have Android Studio, you already have it. Open it up with these steps:

  • Run React Native app normally (react-native run-android)
  • Run Android Studio
  • On the menu, click Tools → Android → Enable ADB Integration
  • Click Tools → Android → Android Device Monitor
  • When Android Device Monitor shows up, click Monitor → Preferences
  • On the dialog, in Android → DDMS, check these two options:
  • Heap updates enabled by default
  • Thread updates enable by default (optional)

Then you will see a pie-chart type data in System Information tab.

In order check Heap allocation and/or usage, select your app on the Devices tab on the left.

Devices tab on Android Studio

Reference
https://shift.infinite.red/react-native-android-app-memory-investigation-55695625da9c

Upvotes: 2

Related Questions