Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Changing WebView html source causes memory leak

$
0
0

Hi,

I did a test on Xamarin Studio 6.12, with our app, targeting on a Samsung S4 device with Android 4.4.1.

The test created a Webview object:

    ... new WebView {
            VerticalOptions = LayoutOptions.Fill,
            WidthRequest = Size,
            HeightRequest = Size,
            Source = new HtmlWebViewSource { Html = htmString }
        };
    }

then changed the Html string 720 times.

Then I found:

1) In time frame: 20:57pm to 21:45pm, in 48 minutes, app memory usage climbed from 185 to 205. That's 20mb increase. Average increase is 417kb/minute, 27kb per html-src-change.

2) then app was idle afterwards and memory usage stayed.

So, the test shows changing webview html source causes average 27kb memory leak.

Does anyone else have seen same issue? And what could be the solution?

Thanks.

Richard Jiang


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>