Why some of my screens are using some much lua memory?

Hi guys.

Another issue that I am having. Again using Using the code from Don-Duong Quach (the Corona profiler) for some screens I can see that memory (lua memory not texture) goes up for a while then suddenly goes down and slowly goes again. I am assuming the GC is at work. The funny thing is that on some screen the same pattern happens BUT the memory does not goes as much.

In one screen the lua memory goes from 294k to 654k but in another screen the memory goes from 286k to 339k. Also the frequency of the pattern is much higher when the memory useage is low than when the memory useage is high. I am just concern of why the memory goes up slowly to around 700k with anything moving around (unlike the gameScreen where the action of the game happens) The two screens are simply the game options screen and the score screen. In both screen only some buttons are displayed and nothing dynamic is suppose to happen (no moving objects, timers...) In those two screens I am using movieclip.lua but commenting that did not seems to make any difference if i remove it.

Here what it look like:

http://postimage.org/image/3mt5nnyhz/

Another image:

http://postimage.org/image/vt6tgo2nb/

The top part shows the start menu screen where the memory goes up and up then goes down. The bottom part is the screen when i switch to the score screen.

Any suggestions?

Thanks.

Mo

I am assuming the GC is at work

Is it?

What are the differences between the two scenes? Dot point them. Chances are that will answer the question.

If they are identical then it's a matter of not removing something properly, then loading a new screen and memory usage therefore being higher.

Peach :)

Thanks Peach! I agree I am sure it is GC at as well. What baffle me is why the lua memory goes up and up then goes down in my menu screen. I only have ui buttons and no transistions, timers or spawning any new objects in that menu. That menu screen is the first screen after main (using director). The other screens are options and score. Options screen has those ups and downs ( so it is normal) but the memory go from 290k to 330k and back. The score screen memory useage look like the menu screen and go to 600k before going down to 300k. Not sure why so much difference between screen. All those screen have the same type of ui (buttons) and nothing else. So the problem is not that some screen are using more memory than other but why in some screen the memory goes up so high (double) and then goes down.

Thanks Peach. I am very sorry I missed you in your US travel. I hope you will be back in the Bay Area!

Mo

views:1475 update:2011/11/8 8:33:25
corona forums © 2003-2011