Why does UIWebView consume so much memory?

I use UIWebView to load a clean HTML text page for my iPad application. HTMP page size is only 40KB. But when I use the tool to monitor memory usage for loading UIWebView, I find that it consumes like 20 MB memory, if I view the web view, the memory even gets higher. Finally, I get a Level 1 memory warning.

Can anyone help me with this? How can I reduce memory for this? (I need to use HTML to display here).

 NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"SPC"];
 NSURL *url = [NSURL fileURLWithPath:htmlPath];
 NSURLRequest *request = [NSURLRequest requestWithURL:url];
 [webView loadRequest:request];
+3
source share
1 answer

htmlPath URL Request

[webView loadRequest: request];

webview dealloc webview ivar

0

Source: https://habr.com/ru/post/1772684/


All Articles