IOS7 webkit crashes often without freeing up memory?

I notice that my Phonegap application is having memory problems on iOS7 that were not running on iOS6.

  • long iScroll lists with many images
  • displaying images from a phone album (9 pp) will crash after viewing multiple

For # 1, this was never a problem for iOS6, regardless of device.

For # 2, I reuse the same DIV element to display the next image, so it seems that the previous image is not clearing.

The methods mentioned in this post no longer work in iOS7: iPad / iPhone browser crashes when loading images in Javascript

+5
javascript mobile-safari ios7 cordova
Oct 03 '13 at 4:44
source share
1 answer

The best solution for this problem I found the following code:

var img = document.getElementById('imageID'); img.parentNode.removeChild(img); img.src = 'data:image/gif;base64,' + 'R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; setTimeout(function() { img = null; }, 60000); 

This sets the src attribute to a tiny gif, and then waits long enough for garbage collection to eventually happen.

See: http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/

This should work for you. I could make sure the memory was released using Xcode tools. Unfortunately, this solution does not seem to work for the home applications that I use.

+3
Nov 05 '13 at 10:21
source share



All Articles