[mono-android] Possible GC Bug?

Aaron Knabb aknabb at mobileepiphany.com
Fri Mar 18 12:43:58 EDT 2011


So I'm having trouble disposing when my activity is recreated (rotation is
the primary example). If I create and dispose a large bitmap over and over,
everything seems to work great and I do not run out of memory. However, if I
am creating and disposing of a large bitmap every time my activity is
recreated (say in an ImageView), I run out of memory before long. I put
logging in to make sure that the dispose is getting called before the next
create, and it is. My fix was to add a GC.Collect() after disposal of that
large bitmap. Should GC.Collect() be necessary in this situation?

Thanks,
-Aaron

***This e-mail message is intended only for the named recipient(s) above. It
may contain information that is confidential and/or privileged and protected
by applicable trade-secret law. If you are not the intended recipient, you
are hereby notified that any review, dissemination, disclosure, distribution
or copying of this e-mail and any attachment(s) is prohibited. If you have
received this e-mail in error, please notify the sender immediately by
return e-mail and delete this e-mail and any attachment(s) from your
system.***
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110318/0e2bba98/attachment.html 


More information about the Monodroid mailing list