If you look at the code above, your arrays persist for the entire application since they are defined in main. The regions that you push on to the array hold a reference to their bitmap. This means the bitmaps created there also persist ( continue to be referenced ). You would need to set those top-level references to invalid to get rid of the bitmap in memory. You should use a telnet session at your device IP, port 8080. Issue the command r2d2_bitmaps (ignore the initial command not found message and reissue the command) this shows all the bitmaps in memory and how much memory is being used. This way you can be sure you have gotten rid of all references
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )