So I have built a fairly large application that is an extreme memory usage due 
to the graphics it contains (large quantity and high res). 

Right now the app has a single view, but allows the user to switch between two 
views. When the user switches views I wipe out the contents of the first view 
(remove most of the items from memory, but a a few still hang around an wait 
for the GC to remove them). 

I am thinking about making the app be document based, so several views up at 
the same time in a tab navigator. 

My question is, if I use modules for each document view will the document views 
not current displayed, not on the selected tab of a tab navigator use any 
memory or any of the cpu if they are not being displayed and if nothing is 
happening while they are not displayed?

Or would it be better to stick with the single document view I have now?

Also, somewhat related. I learned OOP via Adobe > Flash > Actionscript and have 
recently started learning Obj-C for iPhone development. They say its best 
practice to delete all your vars of object instance from within your functions 
to remove them instead of letting GC remove them.

So something like this in AS3:

public function myASFunction() : void
{
    private var house:Object;
    private var str:String;
    public var txt:TextField;

    ...do something with the above vars...
    house = null;
    str = null;
    txt = null;

}

Not sure if this is the correct way to remove the vars, but the idea is clean 
up after yourself in each function so the GC doesn't have to do it and then 
that frees up the GC to handle the really important stuff?

TIA

Reply via email to