Tuesday, May 28, 2024
 Popular · Latest · Hot · Upcoming
69
rated 0 times [  71] [ 2]  / answers: 1 / hits: 9651  / 9 Years ago, fri, june 12, 2015, 12:00:00

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:



enter



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?




  1. Is there an equivalent to the garbage collection button that I can call inside Cordova?

  2. Can I get iOS to give my app a special large memory allowance?

  3. If the user navigates between pages X times within a minute period, I can put up a time-out screen that tells them they can't use the app for the next minute while garbage collection goes XD

  4. Any way to lower the memory usage on the slope up, as JS is rendering HTML?



Also, here is the Chrome graph with HTML nodes – grow proportionally but the nodes stay at same level post garbage collection.



enter


More From » ios

 Answers
1

You could try using the WKWebView plugin, which can sometimes reduce iOS memory usage for Cordova apps.


[#36390] Thursday, June 11, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
masonm

Total Points: 167
Total Questions: 87
Total Answers: 103

Location: Rwanda
Member since Wed, Jun 8, 2022
2 Years ago
masonm questions
;