React native app rapidly consumes memory? - react-native

I've started to fiddle around with React Native, I followed the directions on the start page exactly. After initiating a new project I opened up the file in xcode and the build succeeded. The test application, which is just a view and some lines of text, seems to rapidly consume memory. After letting it run for 5 minutes it's at 284.5mb of memory used and climbing. This seems wrong. Is there a memory leak here? If so, what could be causing it or how could I track down what the cause is?
I'm using react native version 0.17.

There is no RN version 0.1.7... there is 0.17.0 coming though. You might be seeing the memory leak originally reported in 0.15.0 which should be fixed in the upcoming version 0.17.0. See: https://github.com/facebook/react-native/issues/4538

Related

My react native app with expo takes a long time to load

I developed an application in react native using expo and I have a problem, the app takes a long time on the splash screen before starting, I didn't use any method to make the splash visible for a longer time. The issue occurs in both the development version and the production version.
Another point is that I read in an article that IIFE functions should be avoided inside useEffect, and so I removed the ones I used but I still have the performance problem, does anyone have any ideas on how to improve?
If the connection is made but bundle building is very slow - Try disconnecting from the network both devices, and reconnect your system . Also, don't forget to clear the 'recently in development' projects, terminals and start the project again. It will increase the speed of building , especially for windows it works very well.

React native app sourcemaps show incorrect location of error when error happens in asynchronous code

I have a react-native app. I recently moved to react-native version 0.61.5 for which I took the long route of creating a new react-native app and porting my code over to avoid any linking issues since new version used PODFILE as the default linking mechanism. Ever since I moved to version 0.61.5, I don't get the correct location of code in error logs. I think this is mainly happening when the code is running in asynchronous fashion which most of the code is. For e.g., look at below screenshot:
It is reporting that it is not able to call map on some array which is apparently undefined but the place where the error is reported is completely incorrect. I have no such file in my codebase and it is probably pointing to some file in some react-native package.
I am using Sentry #sentry/react-native": "^1.1.0". I don't think Sentry can cause issue with the sourcemaps reported during development.
I am not sure how to debug this problem. This problem is causing a lot of issues in debugging any errors as I have to manually figure out where the error happened. Please let me know if you have any tips on how to fix this problem.

Did official React Native CLI Quickstart guide. Won't start, stuck at Loading dependecy graph

I'm on the latest Windows 10 version with React Native 0.60. Did the official React Native CLI Quickstart guide. Running "react-native run-android" creates another command line window, which is doing the Metro Bundler stuff and Loading dependecy graph... never finishes. Once it reaches 4GB of memory usage it just closes automatically. I think it is some kind of a memory leak. A small example program doesn't need many resources. Anybody saw anything like this?
Solved.
I had to do what cbpetersen wrote here: https://github.com/facebook/react-native/issues/11696
Had to downgrade to node.js 12.4 because of this: https://github.com/facebook/react-native/issues/25698

Nativescript Vue v-if memory leak

Issue
https://github.com/nativescript-vue/nativescript-vue/issues/492
brief synopsis
Using a custom tab-routing strategy in Nativescript-Vue I found that my application was leaking memory. The routing strategy relies on one overarching component that will toggle active components via a v-if statement. When the user navigates to a new page, the v-if statement will hide(and destroy) the old page and show(and mount) the new page. In theory the old page should be destroyed and the memory collected by the garbage collector; however, in practice the memory piles up and never seems to be released from the application, even when calling the garbage collector manually.
testing and reproduction
This issue was tested and found on a real ios device (emulator seems to have no memory issues but I have read that it's not like a real device). The github issue provided above can provide some further detail, and the repository linked below demonstrates a minimal reproduction to cause a memory leak.
A reproduction of this error can be found at https://github.com/geodav-tech/nativescript-vue-memory-leak.
After building the project, run it through xcode, look at the memory profile, and navigate back and forth from the states list to the example list that gets generated on mounted. screenshots also provided within readme
I expect the memory of the hidden components to be cleaned up after they are destroyed and currently even if you leave the app open for several minutes the garbage collector does not reduce the load.
question (edit)
Does anyone have any reasoning behind the memory being held by the application? Is there a better way to accomplish a routing strategy similar to this that wouldn't cause a memory leak or is something about the flow of the program a bad strategy?
To anyone facing memory leak issues similar to this, the answer lies in updating.
The projects facing this issue were compiled against:
nativescript ios runtime: 5.0.0
nativescript android runtime: 5.0.0
tns-core-modules: 5.0.2
nativescript-vue: 2.0.0
Updating to the following fixed the issue.
nativescript ios runtime: 5.4.0
nativescript android runtime: 5.4.0
tns-core-modules: 5.4.0
nativescript-vue: 2.2.2
Now the exact same structure is freed up once navigated away from.

React native server stops transforming every time

React native was working perfectly till today. But, Suddenly I'm facing a weird error. Whenever I try to load js from the react native android app. I'm getting the following messages.. Transforming progress bar is stopping exactly in 96% every time.
Let me know, If you need any extra information.
Thanks,
In my case, This was due to a package called MaterialReactNative. If there is some problem in the package, this will be stopped in transforming. If you want to know which package is making this problem. You can start react native in verbose mode.
react-native start -vvv
I hope that this will help few people who are facing the same issue.