sonnykr
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2014
12:53 PM
[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.
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.
3 REPLIES 3

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2014
02:13 PM
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
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 )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2014
05:28 PM
Re: Manual Garbage Collection
Also, the video memory is actually released only after you call SwapBuffers() the next time.
- Joel
- Joel
sonnykr
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-24-2014
07:07 AM
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) š