Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView leaking memory when loading .RTF files?
    primarykey
    data
    text
    <p>Trying to load a .rtf file (2.4 MB) via webView like this: </p> <pre><code> NSURL *docURL = [NSURL fileURLWithPath:docPath]; NSData *data = [NSData dataWithContentsOfURL:docURL]; NSString *mimeType = //receiving proper mime type here [webView loadData:data MIMEType:mimeType textEncodingName:@"utf-8" baseURL:docURL]; </code></pre> <p>Loading such files leads to memory growth until app crashes. According to the Instruments memory growth continues even after complete deallocation of webView containing controller and webView itself. Being in other place of the application, using other app features, memory grows as if I'm still continuing browsing that .RTF file.</p> <p>When closing/dismissing the controller I also do all things to deallocate WebView. That is: mainWebview.delegate = nil; [mainWebview stopLoading]; , [mainWebview removeFromSuperview]; , [mainWebview release]; . (Even tried to do the following: [mainWebview loadHTMLString:@"" baseURL:nil]; )</p> <p>What I see in instruments: <img src="https://i.stack.imgur.com/32Otr.png" alt="enter image description here"></p> <p>Does anybody have any ideas? Thanks.</p> <p><strong>EDIT:</strong> I tested some large .RTF files (700 Kb - 2.4 Mb) on Safari, Chrome, Mercury browsers. Same thing happens everywhere, both simulator and device. I guess it's some bug in WebKit. </p> <p>General situation: browsers use too much memory to process this kind of files. In 90% of cases just abnormally exit with "Crash" or "Low Memory" signal. If device handles peak memory usage when loading the file then memory drains back to normal, if not - it crashes. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload