question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Memory Allocations

See original GitHub issue

Description

  • 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:closed
  • Created 7 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
stale[bot]commented, Dec 3, 2017

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.

4reactions
w3z315commented, Aug 28, 2017

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.

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found