Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 

roTextureManager How does it cache images?

In my understanding, roTextureManager stores images in tmp:/ storage after downloading and creates and returns bitmaps when .GetBitmap() method is called and then bitmap is discarded (it takes memory until users own bitmap handle points to it). So it should not have any effect on memory. Then whey is it written here http://forums.roku.com/viewtopic.php?f=34&t=69730 that Bitmaps created with CreateObject can interfere with execution of roTextureManager. Also we need to call .Cleaup() method to unload images, so if images are only being stored in tmp:/ and being loaded in memory only once for a short span of time when .GetBitmap() is called then why is it stated here that what is meant by calling .Cleanup() method to unload images? As in my understanding cleanup will only delete images stored in tmp:/ storage?
0 Kudos
3 Replies
NewManLiving
Level 7

Re: roTextureManager How does it cache images?

Open a telnet at your box ip:8080. Issue the command r2d2_bitmaps to see what happens to memory with use of rotexturemanager as well as any other method. To get rid of rotexturemanager cache you explicitly need to unload or cleanup. The nice feature about the manager is its LRU. Asynchronous retrievals are fast under ideal conditions with subsequent retrievals even faster. As far as creating an robitmap while a manager is active I personally have never had an issue.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
belltown
Level 7

Re: roTextureManager How does it cache images?

"scorpiontahir02" wrote:
In my understanding, roTextureManager stores images in tmp:/ storage after downloading and creates and returns bitmaps when .GetBitmap() method is called and then bitmap is discarded (it takes memory until users own bitmap handle points to it). So it should not have any effect on memory. Then whey is it written here http://forums.roku.com/viewtopic.php?f=34&t=69730 that Bitmaps created with CreateObject can interfere with execution of roTextureManager. Also we need to call .Cleaup() method to unload images, so if images are only being stored in tmp:/ and being loaded in memory only once for a short span of time when .GetBitmap() is called then why is it stated here that what is meant by calling .Cleanup() method to unload images? As in my understanding cleanup will only delete images stored in tmp:/ storage?

tmp:/ storage IS memory.
https://github.com/belltown/
0 Kudos
TheEndless
Level 7

Re: roTextureManager How does it cache images?

"belltown" wrote:
tmp:/ storage IS memory.

Different memory that that used by roTextureManager.

OP, the problem is that the roTextureManager only knows about what's been loaded into it, and its memory allocation is fixed. If you're loading/creating bitmaps outside of the texture manager, then they are using the same memory as the texture manager, but the texture manager isn't aware of them, so it can no longer effectively manage its LRU cache.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos