View Full Version : iPad html5 stability (Safari sucks?)

5 Dec 2010, 12:23 PM
This is tangentially a Sencha Touch question, in that I'm only really using Sencha Touch in my significant html5 project. I'm wondering what other people out there think of the stability of html5 apps on the iPad (or iPhone/iPod touch). What I've found is that I OFTEN get crash-to-homescreen problems in my app. These are, of course, not reproducible. And they are in an app that makes a lot of use of google maps. It just seems that it eventually gets tired of all the javascript and craps out. Another reason why I'm not blaming this on Sencha Touch is that, quite simply, nothing it does should ever even be ABLE to crash the browser.

So, any other experiences by folks working on iOS devices? I will also note that my desktop (XP) Safari wasn't all that much better until the 5.0.3 update. I used it to test my app and it was crash as hell.

Edit: Oh, and it may be my imagination, but I think it's gotten slightly better with iOS 4.2. But it still crashes. And I use my apps by opening them in Safari and choosing "add to home screen."

Edit: Seems like a lot of it might be mobile Safari's incompetent image handling, causing it to run out of memory:
That'd certainly be a factor with an image-heavy component like google maps.

5 Dec 2010, 7:05 PM
I wouldn't say "incompetent" is the right word. Apple has put a limit on Safari to how much of memory it can take up. If you over do it, it will crash. This can somewhat be managed with how many things you have rendered at one time.

5 Dec 2010, 7:46 PM
<i>If you over do it, it will crash.</i>

That's incompetent. Websites aren't each in their own memory space, so crashing my five other windows I have open because one site decides to misbehave (and by "misbehave" I mean "use google maps quite a bit") isn't good program design. This should really be managed better by the browser itself.

5 Dec 2010, 7:49 PM
It's doing as it was designed to do. As a developer, you just have to work around it. Don't expect too much

5 Dec 2010, 7:53 PM
Let me say that doing the same type of stuff in a native app has given us no crashing problems. The reason I'm expecting to be able to have an html5 app that performs as well as a native app (at least in the ways that html5 shouldn't be the limiting factor - I'm not trying to do a 3d engine or anything) is because that's the posture Jobs has taken on it. He's promoted html5 over and over again. It's sad that he's doing so when his device isn't up to it. This is supposed to be the way we save ourselves from Flash crashing the browser constantly, after all...

6 Dec 2010, 3:54 PM
Oh, and I should point out that if you go to the stack overflow link, you'll see that it's not just trying to make do with limited memory. It appears that the real problem is that it never frees up any memory on a page until that page is reloaded/closed. So if you keep loading images, there's no way to free the memory when you're done with them. So it's really Safari that isn't managing its memory properly. The web page has no real control over it, other than to just not be able to offer the same features as other platforms are capable of.

6 Dec 2010, 5:33 PM
Sounds like a bug, have you reported it to the Webkit people?

Is your problem just with Google Maps? If image loading in general is the problem, I've seen it suggested that using background-image can work around this problem. ( http://stackoverflow.com/questions/3925178/ipad-memory-issue-loading-images-in-uiwebview )

6 Dec 2010, 7:19 PM
If they don't already know it, they're incapable of testing their browser and all hope is lost. :D