I agree. You should have only one instance of roTextureManager for the entire app. There is no point in invalidating it. But, what Im talking abt is keeping the roTextureRequest instance alive until its corresponding roTextureRequestEvent is returned.
"NewManLiving" wrote:
each time you request a texture create a new request. I reused them initially and had problems. Generally you want to keep your request in an AA by ID. You can also use an AA as a structure which contains an rotexturerequest member as well as other information that identifies the purpose of the bitmap including a bitmap member where you keep the bitmap. Keep a list of these structures in an AA by the texturerequest ID. When the request returns pull it from the list by the returning requests ID ( you will have to convert to string on both ends). In case of failure do not reuse but create a new one from the information stored in the associated structure and resend. You can also keep a resend count in the structure so you know how many times you requested it.
"NewManLiving" wrote:
I use roURLTranfer to file for images that I need to persist for the entire application or module. I designed my framework to load and unload these bitmaps from temp which are primarily top-level interface objects. Right now I use CreateObject for these bitmaps and the texturemanager for grid bitmaps. So far, I have not had a problem mixing the two
"scorpiontahir02" wrote:"NewManLiving" wrote:
I use roURLTranfer to file for images that I need to persist for the entire application or module. I designed my framework to load and unload these bitmaps from temp which are primarily top-level interface objects. Right now I use CreateObject for these bitmaps and the texturemanager for grid bitmaps. So far, I have not had a problem mixing the two
Ok, actually I was talking about the image we load from pkg:/ but as you said you are using createobject for tmp:/ so using it for pkg:/ will be ok too. In roTextureManager's example I saw it to be used for pkg:/ images that is why I asked.
"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.
"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.
"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?
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
0x7d91bbb6 210 300 4 268800 /tmp/download/ec852ebb64f01df79d7cf610c2e92e41
0x7da884c6 210 300 4 268800 /tmp/download/a3ccbd24b8abe15ecb36b655ed0e88fb
0x7d91c646 210 300 4 268800 /tmp/download/c3c31e84e9b0619b84eb1dc91b965849
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!