I have an AIR application that is comprised of four different views. The Stage Mediator has a timer that fires the 'animate in' and 'animate out' functions of each. The model is comprised of some unique and some shared data. For example, the first state of the application displays the visitors checked into a facility. This checked-in visitor info is necessary for all other views.
Currently, the application has several leaks. It starts with a memory consumption of 70K which builds to 500K after an hour. Here are some methods that I think might be causing the leaks:
- In mediators and proxies that depend on shared information, I am instantiating the proxy that populates the appropriate VO. Can I create some kind of global application-wide variables without having to do this?
- How does facade.retrieveProxy work with regards to memory?
- I'm not sure what the best practice is for garbage collection and PureMVC. The proxies pull data from the web and a database, so each time they cycle in, they need to have updated information. I was going to set the data and views to null after each 'animate out,' but maybe there's a better way?
Sorry if these questions are hard to understand. If not specific to my issues, I'd still like to hear some of the best practices for avoiding memory leaks with PureMVC. Thanks!