Android Memory Allocations
See original GitHub issueDescription
- What I did:
- Created a new React Native project via the CLI
- Ran the app on a 5x+23 API Emulator via
react-native run-android
- Opened the Android Monitors tab
- What I expected:
- I expected the memory allocations to rise at app startup and then plateau.
- What actually happens:
- Memory is slowly getting allocated even while the app is just sitting there without any user input.
- When the memory hits the allocated threshold a garbage collection occurs.
- Its good the memory can actually get garbage collected meaning there isn’t a memory leak.
- However why is memory always getting allocated??
Reproduction
I have a screen recording uploaded here: https://youtu.be/F3875gv6tAw
Solution
- Figure out what is being allocated so often and stop it.
- Is this related to debug builds only or also release builds?
Additional Information
- React Native version: 0.37.0
- Platform: Android (maybe others, untested)
- Operating System: MacOS
- Android OS: 23
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Overview of memory management - Android Developers
Android's memory heap is a generational one, meaning that there are different buckets of allocations that it tracks, based on the expected life ......
Read more >Manage your app's memory - Android Developers
See how your app allocates memory over time. The Memory Profiler shows a realtime graph of how much memory your app is using,...
Read more >Inspect your app's memory usage with Memory Profiler
To record native allocations on devices running Android 10 and higher, select Record native allocations, then select Record. The recording ...
Read more >Manage memory effectively in games - Android Developers
You can learn more about these optimizations in the topic Memory allocation among processes. This page explains the steps you can take to ......
Read more >Android memory allocation - Stack Overflow
However, my app must be running out of memory long before it reaches that limit. So my question is: how do I allocate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
This is still a thing, I’ve created a new project using react-native-create-project with these dependencies:
"react": "16.0.0-alpha.12", "react-native": "^0.47.2"
And it still allocates memory.