4 Replies Latest reply on Mar 6, 2011 11:33 AM by John Wolfsteiner

    Fixing Memory Leaks in AIR App?

    Shubhra Bhushan Level 1

      Hi Friends,

       

      I'm been facing this memory leaks issue in our app and this has taken enough of our time and resources and we are not being able to find a solution for it.

      I have identified the problem in the module where we primarily need memory related fixes which is - We are setting Repeater's recycleChildren() property to true/false based upon certain conditions which we cant change. Now when this property is set to false Repeater is supposed to be removing its last created objects from memory and creating fresh ones. In our case repeater is unable to delete those. When I managed to get their instances (using createdChildren()) and freed them in code I called System.gc() for releasing the memory back to OS. Now what is happening is that this approach works fine when I run the app from code but when I create its installer (from Installsheild) and formally out in on machines it does not work. I came to know the reason from following blogs:

       

      http://jvalentino.blogspot.com/2009/05/flex-memory-issue-3-garbage-collection.html

      http://gskinner.com/blog/archives/2006/06/as3_resource_ma.html
      http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/System.htm l#gc()
      http://stackoverflow.com/questions/192373/force-garbage-collection-in-as3
      http://gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html

       

       

      Guys, can anyone of you suggest what should I do here? This has become a delivery bottleneck and we need to give a fix where the memroy is released periodically and efficiently so that the end user's system does not hang.

       

      Please help.

       

      Shubhra