Having experienced similar issues with Google Maps, I tried to isolate a minimal test case. I wanted to see if this was perhaps the more general memory management issue.
This code, which simply stores random data in an array, splits Safari on iOS 7 on iPad mini, 16GB:
function randomString(length, chars) { var result = ''; for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))]; return result; } var arr = [] for (var i=0;i<5000;i++) {
You can try this test with your own browser by going to http://vici.org/memtest.html . The script on this page will try to request 50 MB of memory in 1 MB increments. The script shows the work counter, so you will see how well your browser works and when it will work (if that happens). The script stores the results for each ip / user agent combination in the database to be able to draw some conclusions.
On average, iOS 6 (n = 12) allows a script to require about 12 MB. IOS 7 (n = 47) allows the script to require about 15 MB. It is not hard. For both sets, the standard deviation was quite high, ~ 12 Mb. The Xcode Safari emulator doesn't even crash at all (requesting a full 50Mb, probably because it has access to more RAM).
So, we can conclude that the problem is not caused by the fact that iOS 7 leaves less memory for Safari. It seems that the problem, as Philip Kuhn suggested, is in some specific cases? - Safari consumes significantly more memory than in iOS 6. One key to this reason can be found at https://discussions.apple.com/message/23837361#23837361 , where there is a page with 200 divs and the following CSS
div { -webkit-backface-visibility: hidden; }
resets safari.
Using the Leaflet library seems to work around the map issue (see https://code.google.com/p/gmaps-api-issues/issues/detail?id= and https://github.com/Leaflet/Leaflet/ pull / 2149 ), however Leaflet circumvented low memory losses, not javascript level changes, but not css changes. The flyer now circumvents provisions like
context = this
This means that Safari does not clear unused objects. While Apple is not fixing Safari, is it possible that Google can make changes similar to what the guys from Leaflet did?
At the same time, Apple released the IOS7.1 version, which does not fully resolve crashes, but, of course, makes them common.