Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Instruments shows the memory used by UIWebView?

I have an app that runs well on iPhone 4, iPod Touch 2nd gen, iPhone 3G, but that crashes on iPod Touch 4th gen systematically after 2 or 3 memory warnings. I tested it in Instruments, and it tells me the app uses 2MB when the memory warning is sent. This seems to be a very small amount of memory.

I suspect a problem related with the UIWebView and I wander if Instruments actually shows the amount of memory used by UIWebView. 2MB is not enough to generate memory warnings on the previous apps I've been working on.

It's not a leak in UIWebView as I have the crash sometimes at the first time I show an UIWebView.

like image 960
jptsetung Avatar asked May 05 '12 16:05

jptsetung


1 Answers

Try this:

  1. Select "Call Trees" just above the list (default is "Statistics")
  2. Check "Invert Call Tree" + "Hide System Library" + "Show obj-C only"

Now you can browse through the calls which are still in the memory in ascending order. They are not objects, but you should be able to see your selector which calls your UIWebView there. If not create it programatically instead of IB so it will show up for sure.

Also try to check leaks first and use ARC if you can.

like image 135
Tibidabo Avatar answered Sep 28 '22 00:09

Tibidabo