简体   繁体   中英

Cairgrom ModuleLoader memory leaks?

I also found this topic but it doesn't fix my problem other topic

I have a module loader that load other swc's but when I look at the memory off the application it seems that each time a module gets loaded the previous module doesn't get unloaded and so the memory increases..

This is how I load the modules:

  <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>

When leaving the module I do this:

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

But it seems that the module loader doesn't unload the object in his memory. but the unload event is triggered, anybody any idea? How to remove the object from the module loader

There can be several reasons why a module stay pinned in memory, the best you can do is read this excellent blog entry by Alex Harui : http://blogs.adobe.com/aharui/2009/08/what_we_know_about_unloading_m.html

It should help you fix your problem unless you found a new bug :)

Hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM