I'm working on an ipad app which is meant to have several UIWebView controls visible at once, and was wondering what a sensible limit is to the number that we can have before running into memory issues on the ipad?
Thanks
I'm working on an ipad app which is meant to have several UIWebView controls visible at once, and was wondering what a sensible limit is to the number that we can have before running into memory issues on the ipad?
Thanks
You have to be dynamic about it. Don't set a hard limit in your app, wait for the memory warning and then start purging web views, lazily reloading them as the user needs them. You should screenshot the view first using [CALayer renderInContext:]
so it appears seamless.
After all each web view will have different memory and CPU requirements. As always, the mantra is test, test, test.
... but, of course, Safari limits you to nine open tabs. Which is very much a hard limit. So... there's that.
it has no a sensible limit for webview for your app, it depends on the ios that the memory left
but use it carefully, webview is hard to controller the momery ,
it's a trick , before you release a webview do this may reduce the memory uses
[web loadRequest: nil];
use lots of webview at the sametime may not be a good idea
FWIW, I managed to get 20 UIWebviews on screen at once on an iPad 1. The pages all had javascript code in them, they weren't bare bones either. It took a while to load them but i got no memory warnings, and once loaded everything scrolled smoothly. Using the code from here:
Determining the available amount of RAM on an iOS device
I then checked the memory usage, which was:
113M used, 17M free, 131M total, which sounded pretty good.
I didn't push for any more than 20, that's way more than i'll ever use in practice. I'm impressed.