[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 :disappointed_face:

Whats worng here? NewManLiving or other Roku experts? Please help.

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

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

  • Joel

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) :slightly_smiling_face: