I just found that when UIwebview get dealloc-ed, most of the memory it used doesn't get totally recycled. After doing some profile, i found most of the still alive memory are Font glyph cache(the problem is much worse if you are open a chinese web page, as chinese has more characters, which means more font glyph).
Is there any way we can control the cache ? I'm working on a iOS web browser, this problem blocks me for 2 weeks.
Attached is a simple repro demo. 1) Run the demo with memory "Allocation profile". 2) input http://www.163.com in the address bar and waiting it's finished loading. 3) you can see around 10M memory consumed in the instrument tool. 4) click the clear button(the UIwebview will be removed from the visual tree and get recycled) 5) you can still see around 9M memory alive.
BTW, NSURLCache was disabled with below code, to separate the problem. [[NSURLCache sharedURLCache] setMemoryCapacity:1]