5 Replies Latest reply on Apr 26, 2009 11:45 PM by maniChina

    How to clear .._mx_core_FlexModuleFactory after module is unloaded

    maniChina

      Hello, nameless hero~

       

      I have readed everthing I could find online, such as Roger Gonzalez's blog and a post about this problem here, which from Flexcoder group. But I still couldn't solve this problem which the title said.

       

      So If you know how to solve it, please reply me, thanks in advance!

       

      BTW, I have a confused problem , what the instance which as ".._mx_controls_RichTextEditorWatcherSetupUtil" means?

       

      Thanks!

      mani.

        • 1. Re: How to clear .._mx_core_FlexModuleFactory after module is unloaded
          maniChina Level 1

          I have used ModuleManager and ModuleLoader, that's all the same.

          My SDK is Flex3.3, Builder is Flex 3.02. Thanks!

          • 2. Re: How to clear .._mx_core_FlexModuleFactory after module is unloaded
            Flex harUI Adobe Employee

            Use the profiler to find out what has a reference to the moduleFactory.  Usually it is the module itself, which hasn't been fully de-referenced by your code.

             

            A WatcherSetupUtil is code generated by the compiler to handle bindings

             

            Alex Harui

            Flex SDK Developer

            Adobe Systems Inc.

            Blog: http://blogs.adobe.com/aharui

            • 3. Re: How to clear .._mx_core_FlexModuleFactory after module is unloaded
              maniChina Level 1

              Thanks for your reply, I have profile it again, and here is the result:

               

              _MaxFavorite(my module)_mx_core_FlexModuleFacory(5)

                   Function(6)

                        _MaxFavorite_mx_core_FlexModuleFactory

                        mx.core:CrossDomainRSLItem(1)

                             Array(1)

                                  mx.core:RSLListLoader(4)

                        mx.core:CrossDomainRSLItem(1)

                        mx.core:RSLListLoader(4)

                        mx.core:RSLListLoader(4)

                        mx.core:RSLListLoader(4)

                   Function(1)

                        _MaxFavorite_mx_core_FlexModuleFactory

                   Function(2)

                        flash.display:LoaderInfo

                        _MaxFavorite_mx_core_FlexModuleFacotry

                   Function(2)

                        flash.display:LoaderInfo

                        _MaxFavorite_mx_core_FlexModuleFacotry

                   Function(2)

                        _MaxFavorite_mx_core_FlexModuleFactory

                        mx.core:RSLListLoader(4)

                   Function(2)

                        _MaxFavorite_mx_core_FlexModuleFacotry

                        flash.utils:Timer(2)

               

              I fount have 5 reference, Function.. I don't know what it means, could you please explain it for me?

              Thansk again~

              • 4. Re: How to clear .._mx_core_FlexModuleFactory after module is unloaded
                Flex harUI Adobe Employee

                If you expand the pane, you'll see object ID's.  As you expand the back references, most will eventually reference the same object.  For example, the Function() is referenced by the FlexModuleFactory so it is a cycle and not a source of a leak.

                 

                The Timer is suspicious.  There should never be a Timer in the backreferences.  That can certainly cause leaks.

                 

                Alex Harui

                Flex SDK Developer

                Adobe Systems Inc.

                Blog: http://blogs.adobe.com/aharui

                • 5. Re: How to clear .._mx_core_FlexModuleFactory after module is unloaded
                  maniChina Level 1

                  Thank you very much, aharui~

                  Could you please give me any sugesstion about developing by Module?

                  I'm confused by the memory leak problem

                  Thanks again.

                   

                  And I have created other apllication:

                   

                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
                  >

                   

                  <mx:TextArea/>
                  <mx:TextArea/><mx:TextArea/>
                  <mx:TextArea/><mx:TextArea/>

                  </mx:Module>

                   

                  And after I unloaded it, the result is:

                   

                  Function(2)

                       flash.display:LoaderInfo

                       _MyModule_mx_core_FlexModuleFactory

                  Function(1)

                       _MyModule_mx_core_FlexModuleFactory

                  Function(2)

                       flash.utils:Timer(2)

                            Function(1)

                                 flash.utils:Timer

                            _MyModule_mx_core_FlexModuleFacotry

                       _MyModule_mx_core_FlexModuleFacotry

                   

                   

                  Timer is still exsit,  so the problem is?