"scorpiontahir02" wrote:
"TheEndless" wrote:
Just be aware that using CreateObject("roBitmap") does not count against the roTextureManager's LRU management, so if you're loading bitmaps outside of the roTextureManager, then you could very easily overrun the memory. It's also worth noting that roTextureManager isn't aware of you keeping bitmap references alive, so its LRU management may unload a bitmap from its own cache, and think that memory is available to it again, even though it isn't. I believe the general rule of thumb I was told was to keep bitmap references that aren't fully managed by roTextureManager down to under 5mb.
I have tried to look for roTextureManager behaviour using r2d2_bitmaps, what i have seen is that images pulled by roTextureManager does not take space in bitmaps memory until we load bitmap by callingmsg.GetBitmap() and keep a reference to it. So as far as i know roTextureManager takes only that much space which we know of as we have references to those bitmaps. So either we are creating bitmaps with CreateObject or msg.GetBitmap it shouldn't make a difference as we know what total memory is consumed by bitmaps created by both the requests.
It may or may not make a difference to consumed memory, but it does affect the roTextureManager's ability to manage its memory automatically. One of the primary benefits of the roTextureManager is its LRU cache based memory management. If you're keeping references to bitmaps open and/or loading bitmaps into memory outside of the roTextureManager, then that LRU cache functionality is hindered. This is especially important on the older Roku 2 XD/XS and the Roku Streaming Stick, as their texture memory is much more volatile. If you're only testing on a Roku 3, then you're unlikely to see any issues as it has significantly more memory to work with.
"scorpiontahir02" wrote:
Although I don't know where roTextureManager stores images (not bitmaps but files) which it downloads. But it surely is not bitmap memory otherwise it would have shown using r2d2_bitmaps. Am I getting roTextureManager wrong here?
r2d2_bitmaps will list the file location, if it's saved to a file somewhere. For example (see the path in the 6th column):
0x7d4affde 1280 720 4 3686400 /nvram/theme/HD/BackgroundBitmap.jpg
0x3161a9e 100 100 4 44800 /nvram/theme/HD/LabelListFocusBitmap.9.png
0x3ab82ce 100 100 4 44800 /nvram/theme/HD/LabelListFocusFootprintBitmap.9.png
In the case of downloaded images, it usually looks something like this:
0x7d91bbb6 210 300 4 268800 /tmp/download/ec852ebb64f01df79d7cf610c2e92e41
0x7da884c6 210 300 4 268800 /tmp/download/a3ccbd24b8abe15ecb36b655ed0e88fb
0x7d91c646 210 300 4 268800 /tmp/download/c3c31e84e9b0619b84eb1dc91b965849
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)