Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jeko0o
Visitor

Create a Free template with roScreen

Hi all,

I would ask your help with the following, I am trying to create a free template roscreen in order to draw the background screen and buttons to emulate a user interface ... I find it all right, but the function that creates reinvoke these components after a few attempts I elements appear on the screen (if I can create but not display) .. apparently many objects are being created and the memory is saturated .. that is why I wonder if there is any way of free video memory or forcing the destruction of an object that is not using ..?
0 Kudos
3 REPLIES 3
MSGreg
Visitor

Re: Create a Free template with roScreen

I think setting unused components to invalid (or out of scope) would be the first step. To be successful, there must be no variables pointing to the now-unused element.
If the elements are not part of a circular reference, they should be freed immediately. If they are part of a circular reference, the garbage collector may need to run. In most circumstances, the automatic call of the garbage collector should be sufficient. See "Garbage Collection"
0 Kudos
MSGreg
Visitor

Re: Create a Free template with roScreen

Note that another post suggests there is only 18MB-22MB of video memory available after everything else is allocated. If this is in fact the only available memory for roBitmaps (and I'm not sure of that), then you will only be able to get approximately 3-4 full-size HD (1280x720) bitmaps in memory as "standby" components. It's worth testing to determine the limits.
0 Kudos
jeko0o
Visitor

Re: Create a Free template with roScreen

MSGreg thanks .. I finally solve the problem .. the problem was that this saturating the memory of objects that kept a reference .. that is why were not released .....
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.