Hopefully this is a quick response for some of you experts, even though it’s kind of a multi-part question.
1) If I am implementing the ui.lua button (or multiple in a scene), what is the proper way to dispose of these? I am using the director class and have my own cleanup method ready to go when the scene changes. I suppose I am most concerned with how the button listener get’s disposed of.
On a related note, I am tracking memory usage from scene to scene. **Is it normal:
a) for the lua mem usage to continue to rise for some time (15-20 sec) at which point GC kicks in and lowers the memory but NOT to the original usage reported by the scene at load time?
b) as I change between two scenes, the lua memory usage change fluctuates proportionately up and down however, the base values seem to go up. It’s like each time I go into a new scene, the base memory jumps up but only the first time it’s accessed. My instinct says there isn’t a memory leak but I don’t trust my instinct 100% here.**
example:
scene 1 reports 178.3 -->
switch to scene 2 which reports 239.1 -->
return to scene 1 reports 190.5 -->
back to scene 2 reports 239.1 -->
back to scene 1 reports 190.6
in this example, if I continue to load additional scenes, it seems the base values of memory usage do go up but as I switch back and forth between them, they maintain consistent values so it seems like each scene is properly disposing of what was in it but something is hogging additional memory. Any clues as to why that is?
I appreciate any help or insight out there.
[import]uid: 15934 topic_id: 6664 reply_id: 306664[/import]