I’ve been getting lots of questions about memory leaks lately. I finally found some time to put my techniques for analyzing memory leaks into writing.
Instead of using PowerPoint, I actually created a SWF so you can use the SWF to both view the presentation and learn how to use the Profiler. I cover the differences between profiler memory, System.totalMemory and process memory and show how I analyze the two most common memory leak scenarios.
Run Presentation
As usual, caveats apply.
The SWF also demonstrates an approach to another topic I’ve heard about often, and that is how to do XML-driven or data-driven UI. The presentation in this SWF is controlled by an XML file. A single engine parses the XML and creates the UI widgets as dictated by the XML. To change the presentation, all I have to do is change the XML. I can also add new widgets easily. Source is available here:
Download FlexBuilder Project
The SWF also demonstrates a technique for improving startup time. Because our blog system is painful to use, I don’t like uploading more than one or two files per blog post, but this presentation had more than a dozen images. So, instead of loading images externally, I embedded them into the SWF, but normally, that delays startup by the download time of all of those images. To get around that, I pack all the images into frame 3 of the SWF so that Flex can get up and running while the images download at the end of the SWF. I can get away with that because the images are not needed right away.
Hope this helps.
Categories
Archives
- May 2012
- October 2011
- April 2011
- March 2011
- February 2011
- October 2010
- March 2010
- February 2010
- January 2010
- December 2009
- August 2009
- May 2009
- December 2008
- November 2008
- September 2008
- August 2008
- June 2008
- March 2008
- February 2008
- January 2008
- October 2007
- August 2007
- July 2007
- June 2007
- April 2007
- March 2007
-
Recent Posts
