I have a simple app with one button (just for testing) and the memory usage in the application is about 83 MB. Here is My Code. I am wondering that the app size is about 18MB and it's using a lot of memory. this is the same problem in a real app where the memory usage is about 190 MB and increases over time as I navigate in the app and after some time the app is going to stick on the android device have memory less or equal to 1GB and on iPhone 6 real device.
import React, { useCallback, useEffect } from 'react';
import {Text, TouchableOpacity , View} from 'react-native'
import SplashScreen from 'react-native-splash-screen';
function Foo () {
useEffect(() => {
SplashScreen.hide()
},\[\])
const handleClick = useCallback(() => {
console.log('Click happened');
},\[\])
return (
<View style={{flex:1, width:'100%',justifyContent:"center", alignItems:"center", height:"100%"}}>
<TouchableOpacity
style={{
backgroundColor:"gray",
borderRadius:10,
justifyContent:"center",
alignItems:"center",
width:"80%",
height:50
}} onPress={() => handleClick()}>
<Text style={{color:"#fff", fontWeight:"bold"}}>Click</Text>
</TouchableOpacity>
</View>
)
}
export default Foo;