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

Bitmap image not releasing resources

$
0
0

I have a page that displays one image. im testing with the exact same one and only one image.

Every time I view the page I get the following message (in the android log)

I/dalvikvm-heap( 1313): Grow heap (frag case) to 54.737MB for 15872272-byte allocation

the value however always increases - every time I go to the page.

im setting the source of the image to null in OnDisappearing of the page.

protected override void OnDisappearing()
{
  var p = Photo;

  p.Source = null;

  base.OnDisappearing();
}

the source is a StreamImageSource.

however it makes no difference - the heap just keeps growing until I get an out of memory exception after about the 10th viewing of the page.

So it seems to me setting the source to null is not disposing of the resources associated with the image.

Im using x.forms 1.3, Android 4.4.

Ive not tried it on other os's.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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