I can't speak to any GC problems, but I'm curious: is this a large bitmap
that takes awhile to download? The code you have there to download the file
is synchronous...are you running it on a background thread when you call it?
If you're doing a long-running synchronous operation on the UI thread, that
would certainly explain your app locking up.

On Wed, Aug 17, 2011 at 5:04 PM, Willem Meints <[email protected]>wrote:

> Hi,****
>
> ** **
>
> Anybody ever observed the following behavior when trying to download an
> image from the internet?****
>
> The following code:****
>
> ** **
>
> private Bitmap LoadThumbnail(Uri eventImageUri)****
>
> {****
>
>     Bitmap result = null;****
>
> ** **
>
>     try****
>
>     {****
>
> ** **
>
>         var request = HttpWebRequest.Create(eventImageUri);****
>
>         var response = request.GetResponse();****
>
> ** **
>
>         if (response.ContentLength != 0)****
>
>         {****
>
>             Stream responseStream = response.GetResponseStream();****
>
>             result = BitmapFactory.DecodeStream(responseStream);****
>
> ** **
>
>             responseStream.Close();****
>
>         }****
>
>     }****
>
>     catch (Exception e)****
>
>     {****
>
>         DeviceContext.Current.Log.WriteError(e);****
>
>     }****
>
> ** **
>
>     return result;****
>
> }****
>
> ** **
>
> Causes the GC to start collecting chunks of 2K and the app to stop
> responding. I’m not doing doing anything weird, so I can’t really relate to
> the problem I’m seeing :S****
>
> ** **
>
> LOGCAT OUTPUT****
>
> ======================****
>
> ** **
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 54ms****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 46ms****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 53ms****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 49ms****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 54ms****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/9015K, paused 48ms ****
>
> D/dalvikvm( 1244): GC_EXPLICIT freed 2K, 56% free 3226K/7175K, external
> 5598K/90….****
>
> ** **
>
> Kind regards,****
>
> ** **
>
> Willem Meints****
>
> ** **
>
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to