Memory Optimization

Hi all, I am 1/4 way into my game engine… currently I feel that it has some memory issues. ;( Using the activegraph, I can see my line chart keep going up one… lol

Just some question, is it only objects which are displayed will occupy memory? What about code and variables? Do I have to clear them? Arrays?

I am building a tetris game, so bricks are continually added into my game, when they are exploded, I remove them using…


            if(numChildren > 0){                
                while(numChildren) removeChildAt(0);
            }
            this.parent.removeChild(this);

Do i need to do more?