title: PhoneGap using way more memory in iOS8 than iOS7
body: <p>I have a PhoneGap app. An HTML5 Canvas game. It appears to use significantly more memory in iOS 8 (including 8.0.2) vs iOS 7. </p>
  
  <p>In addition to using more memory, the JS Garbage Collector does not seem to ever free up the memory it is holding. It is collecting "freed" memory correctly, but never releasing it back for iOS to use. </p>
  
  <p>Here is the memory usage using Instruments Allocations under iOS 7 with an iPhone 5S. As you can see it goes up and down as I load and unload a level. Also the memory usage is very low, at around 23mb, maxing at 41.81mb</p>
  
  <p><img src="https://i.stack.imgur.com/OOmOW.png" alt="PhoneGap Canvas app running under iOS 7"></p>
  
  <p>Here is the same app running on an iPhone 5S with iOS 8.0.2. As you can see the memory usage never goes down and it uses significantly more memory. In fact the memory usage keeps going up forever as I load and unload the same level. It doesn't go up as high, which makes me think JS is correctly re-using memory from the Garbage Collector, but the GC never seems to free the memory it is holding back to the OS. Also the entire app seems to be using way more memory than before. </p>
  
  <p>The app also runs a lot slower and reached 121mb by the time I stopped it. </p>
  
  <p><img src="https://i.stack.imgur.com/yZBkU.png" alt="PhoneGap Canvas app running under iOS 8"></p>
  
  <p>I should add that when unloading the level I re-load the page, which curiously does not free up any memory under iOS 8.</p>
  
  <p>Does anyone have any ideas what could be causing this problem and what the solution might be? Is this a bug in iOS 8?</p>
  
  <p>In 8.0 (but not 8.1) one could free using a workaround/hack:  calling <code>window.location.reload(true);</code> before forcing a page reload using <code>window.location.href =</code>. Since 8.1 this hack/workaround doesn't work.</p>