3 Replies Latest reply on Apr 9, 2007 8:32 PM by GMina

    Possible Leak in TabNavigator

    byronblue
      We have a pretty big memory leak in our application and we isolated it down to happening in the TabNavigator component. The TabNavigator is contained in a custom mxml TitleWindow component. We instantiate our custom TitleWindow component via createPopUp or addPopUp then remove it but it always leaks. I found a hack online that forces to GC to collect so we are pretty sure that this is where the leak is coming from.

      Has anybody else had any experience with this or does anyone know a work around to actually free the memory used by the TabNavigator? Nulling out its reference and programmatically removing its tabs/children does not work..
        • 1. Re: Possible Leak in TabNavigator
          GMina
          I don't think the memory leak is with the TabNavigator. I believe it is with the PopUpManager singleton. I am experiencing a memory leak with this simple code:

          var test : IFlexDisplayObject = PopUpManager.createPopUp(this,TitleWindow);
          PopUpManager.removePopUp(test);

          It doesn't appear the memory is ever freed.
          • 2. Re: Possible Leak in TabNavigator
            byronblue Level 1
            I don't think the PopUpManager is leaking. With my tests forcing the GC to collect after using code like yours does in fact reclaim the memory. It's hard to tell if you are leaking or not without explicitly forcing garbage collection.
            • 3. Re: Possible Leak in TabNavigator
              GMina Level 1
              I was explicitly forcing GC using the following code:

              try {
              new LocalConnection().connect('foo');
              new LocalConnection().connect('foo');
              } catch (e:*) {}

              Apparently (from what I read and experienced) the second call throws an error which forces a full mark/sweep.