mono/MonoGame — pull request #931 by jonathanpeppers (2012-11-02 20:54:17+00:00)
Title: Android - fixed memory usage in Texture2D

We were having lots of memory issues with our Android port, our game would get an OutOfMemoryException when loading textures. It would happen on certain devices, and could sometimes get alleviated by calling GC.Collect() (which I didn't like). It would always happen when trying to load my first 2048x2048 sprite sheet.

So to fix it, I added using statements and a call to Recycle() on any Bitmap object in Texture2D. I removed the use of MemoryStream and read from the original Stream directly. I also used the appropriate BitmapOptions we are using in other apps for better memory performance.

These changes are now working in our game (Draw a Stickman: EPIC http://epic.drawastickman.com), and I want to contribute back.

Let's just make sure I didn't break something for someone else.

MonoGame is great, keep up the good work.