I'm on iOS now, but the question applies to Android too. I'm looking at the memory graph in Xcode, and my app crashes whenever it hits around 240MB, I believe iOS is killing it because it's taking too much memory.
I can consistently get it to crash by navigating between pages in the app. (It's a SPA, client-side HTML rendering.) If I stop navigating for a minute, the memory will go down to 140MB.
Here is same page in OSX Chrome:
In this case, after ceasing navigation, the memory does not decrease on it's own. Instead, the cliff at the end of the graph is me hitting the garbage collection button (takes it down from 170MB to 60MB).
How do I stop my app from crashing?
Also, here is the Chrome graph with HTML nodes – grow proportionally but the nodes stay at same level post garbage collection.
You could try using the WKWebView plugin, which can sometimes reduce iOS memory usage for Cordova apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With