Problem with clean-up

Hi

I got a question about clean-up.

I’m using director and when checking texture memory usage I get the same values for each screen (don’t know why)… I use removeSelf() for all display objects and nil them out too, as well as I remove event handlers from them (this part is done in clean method). Any ideas why it is like that?

Checked director example - the same thing there. I think it should at least change on each screen because there are different display objects… Instead it is constant value always…

Thanks in advance :slight_smile: [import]uid: 28742 topic_id: 6996 reply_id: 306996[/import]

Sometimes you need to look at the memory after a delay. For example, the transition.to method keeps a reference to your object until the transition is complete. And when you call removeSelf(), make sure you call it recursively on any child objects.

Finally, remember that even after you remove something and set it to nil, the memory is not recovered until the garbage collection. You can call collectgarbage(“collect”) to force a garbage collection yourself. [import]uid: 12529 topic_id: 6996 reply_id: 24518[/import]

Thanks your advice helped :wink: [import]uid: 28742 topic_id: 6996 reply_id: 24541[/import]

Maybe I’m asking a stupid question here, but how do I check my memory usage? I never see anything about memory in the Terminal. [import]uid: 22392 topic_id: 6996 reply_id: 26326[/import]

could you please write small example, how to clean the memory ?
[import]uid: 13061 topic_id: 6996 reply_id: 29437[/import]