Cairgrom ModuleLoader内存泄漏?

时间:2012-03-23 10:46:14

标签: flex cairngorm

我也找到了这个主题,但它没有解决我的问题other topic

我有一个加载其他swc的模块加载器但是当我查看应用程序的内存时,似乎每次加载模块时,前一个模块都不会被卸载,因此内存会增加..

这是我加载模块的方式:

  <module:ModuleViewLoader id="moduleViewLoader" moduleManager="{presenter.deviceModuleManager}"
                             top="0" left="0" right="0" bottom="0"
                             moduleId="configurationView"
                             height="100%" 
                             width="100%" enabled="{presenter.deviceLoadable}"
                             ready="presenter.handleModuleLoaded(moduleViewLoader.loadedModule)"
                             error="presenter.handleModuleLoadError(event)"
                             unload="presenter.closeConfiguration(event)">
        <module:loadPolicy>
            <module:BasicLoadPolicy/>
        </module:loadPolicy>
    </module:ModuleViewLoader>

离开模块时,我这样做:

public function resetModuleSpecifications():void {
        closeConfiguration();
        changewatcher.unwatch();
        loadedModule = null;
        lastLoadedDevice = null;
        deviceModuleManager=null;
        deviceBeingConfigured = null;
         }

但似乎模块加载器不会将对象卸载到他的内存中。但卸载事件被触发,有人知道吗? 如何从模块加载器中删除对象

1 个答案:

答案 0 :(得分:0)

模块保留在内存中的原因可能有多种,您可以做的最好的事情是阅读 Alex Harui 的这篇优秀博客文章:http://blogs.adobe.com/aharui/2009/08/what_we_know_about_unloading_m.html

除非您发现新错误,否则它应该可以帮助您解决问题:)

希望有所帮助