Memory problems with storyboard - removeScene() not removing Lua objects

I’m having some major system (Lua) memory problems caused by storyboard not working properly. I’m using build 2012.971. I am manually removing scenes after transitioning away from them (I’ve tried doing so in a number of different places, including in the didExitScene function of the “old” scene and the enterScene function of the new scene). I am monitoring memory use with the profiler tool. Although the textural memory is being freed when storyboard is trying to remove a scene, the Lua memory associated with the display objects or other locally-declared variables is not being removed (contrary to what is supposed to happen, as discussed in the blog post linked to below). All of the local variables declared in the scene, for example, are still being stored in memory as are the widgets (buttons). The local storyboard instance created by each scene is also being held and taking up a lot of system memory.

Is this a problem that has since been resolved in daily builds? It is creating, in effect, a huge memory leak for my game. If Rob or someone else has input, I’d really appreciate it.

http://www.coronalabs.com/blog/2012/07/31/storyboard-scene-purging-vs-removal/ [import]uid: 135391 topic_id: 34915 reply_id: 334915[/import]

Hi @nate2,
Just checking: I assume you’ve nil’led out everything else that might be causing leaks if not freed from memory? All stray (unfinished) timers and transitions? Every event listener and Runtime listener? Every table you might have placed references to other local variables or objects within?

Brent [import]uid: 200026 topic_id: 34915 reply_id: 138763[/import]

Hi Brent - yes, I believe I have. I’m using the Corona Profiler tool from MY Developers in mode 4, which allows me to see the names of the variables still being held in memory and the amount of memory each is taking up (this is a very, very helpful tool). Basically, nothing appears to be released from system memory, i.e. the entire scene module and all local variables are still intact in memory after calling storyboard.removeScene. This happens even though I’ve independently nil’led out those variables, presumably because the storyboard scene module which references all of these local variables is still being held in memory. [import]uid: 135391 topic_id: 34915 reply_id: 138812[/import]

I’ve not used the profiler tool to verify that it’s the same problem but based on your description I’ve experienced a similar type of situation. Looking forward to finding out more about this issue if anyone has any input for you. [import]uid: 105707 topic_id: 34915 reply_id: 138951[/import]

Anyone any ideas on this? It sounds like the ShaqDown developer has also been having some of the same memory problems with Storyboard. This really needs attention.

http://developer.coronalabs.com/forum/2013/01/09/tips-tricks-learned-while-developing-shaqdown [import]uid: 135391 topic_id: 34915 reply_id: 139041[/import]

That post was really insightful, especially their experience with Storyboard.

Storyboard has become my “Land War in Asia”. I’m mired in it and have no exit strategy or path to victory :expressionless: [import]uid: 105707 topic_id: 34915 reply_id: 139123[/import]

Hi @nate2,
Just checking: I assume you’ve nil’led out everything else that might be causing leaks if not freed from memory? All stray (unfinished) timers and transitions? Every event listener and Runtime listener? Every table you might have placed references to other local variables or objects within?

Brent [import]uid: 200026 topic_id: 34915 reply_id: 138763[/import]

Hi Brent - yes, I believe I have. I’m using the Corona Profiler tool from MY Developers in mode 4, which allows me to see the names of the variables still being held in memory and the amount of memory each is taking up (this is a very, very helpful tool). Basically, nothing appears to be released from system memory, i.e. the entire scene module and all local variables are still intact in memory after calling storyboard.removeScene. This happens even though I’ve independently nil’led out those variables, presumably because the storyboard scene module which references all of these local variables is still being held in memory. [import]uid: 135391 topic_id: 34915 reply_id: 138812[/import]

I’ve not used the profiler tool to verify that it’s the same problem but based on your description I’ve experienced a similar type of situation. Looking forward to finding out more about this issue if anyone has any input for you. [import]uid: 105707 topic_id: 34915 reply_id: 138951[/import]

Anyone any ideas on this? It sounds like the ShaqDown developer has also been having some of the same memory problems with Storyboard. This really needs attention.

http://developer.coronalabs.com/forum/2013/01/09/tips-tricks-learned-while-developing-shaqdown [import]uid: 135391 topic_id: 34915 reply_id: 139041[/import]

That post was really insightful, especially their experience with Storyboard.

Storyboard has become my “Land War in Asia”. I’m mired in it and have no exit strategy or path to victory :expressionless: [import]uid: 105707 topic_id: 34915 reply_id: 139123[/import]