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

[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 Smiley Sad

Whats worng here? NewManLiving or other Roku experts? Please help.
0 Kudos
3 Replies
NewManLiving
Level 7

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
Roku Employee
Roku Employee

Re: Manual Garbage Collection

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

- Joel
0 Kudos
sonnykr
Level 7

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) Smiley Happy
0 Kudos