Looking for advice on best practice for releasing memory. I am currently using a tabGroup to page thru windows in succession, just like Kitchen Sink.
Each window opens a new window with a unique JS file for the class/url value.
It seems like when you open a new window (just as the Kitchen Sink App does) it doesn't release any memory from the previous window. Some of my windows have a lot of images and it would be good to release that memory, but I would still need the user to be able to use the 'back' button.
Should I fake this 'back' button and not use the tabGroup? Instead use a system of window.open() and previousWindow.close() methods? Will that release more memory?
Another question would be, when you call window.open(), does that automatically close the window you were previously in?
3 Answers
You can use a tab group and set the 'tabBarHidden' property of the root window of a tab to true so that you can achieve what you are looking for. In this way you need not worry about releasing the memory and the app will look as if you are not using a tab group.
Another alternative is use of navigationGroup control.
@Todd - You have to close the window for the memory to get released. I would probably have my own back button and handle the navigation.
A new window.open() doesn't close the previous one, it just places it on top (if you haven't fiddled with the zIndex)
@Patrick - For a lot of windows my experience is that you're better of updating existing windows then creating new ones for each instance. Log the Ti.Platform.availableMemory to check memory consumption.
/J
Im curious for this too.
My app dynamically creates a window for every "page" we have through a data tabel. Though the simulator crashes after 3 page turns, my guess is that memory gets hogged,
I'm running some tests now trying to figure out if it works I will let you know when I find something or maybe somebody can shed some light?
Your Answer
Think you can help? Login to answer this question!