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: 
sonnykr
Visitor

[Solved] Manual Garbage Collection

Hey,

I am trying to free up memory space each time i exit a page. This is what I do,

1. Invalidate bitmap
2. Invalidate region
3. Invalidate sprite
4. Invalidate compositor
5. RunGarbageCollector()

But as NewManLiving suggested (in some other post, im posting this qn here, since that discussion is way out of my original question), I tried r2d2_bitmaps and found the memory is not actually released. And after few pages, my app crashes due to out of memory 😞

Whats worng here? NewManLiving or other Roku experts? Please help.
0 Kudos
3 REPLIES 3
NewManLiving
Visitor

Re: Manual Garbage Collection

If you are using sprites. You must explicitly
Call sprite.remove for each sprite you create
If you do not memory will not be released
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
RokuJoel
Binge Watcher

Re: Manual Garbage Collection

Also, the video memory is actually released only after you call SwapBuffers() the next time.

- Joel
0 Kudos
sonnykr
Visitor

Re: Manual Garbage Collection


If you are using sprites. You must explicitly
Call sprite.remove for each sprite you create
If you do not memory will not be released

Man, you're awesome. Such a silly thing I missed. Everything looks awesome now (I think) 🙂
0 Kudos