AS3 - 未装AVM1 SWF文件输出时卸载,但内存不释放对AVM2机内存、文件、SWF

2023-09-08 14:43:12 作者:寂寞的烟斗

我有内置的AS3一个大型项目。它的主要功能之一是装载和卸载各种AS2主权财富基金。的问题是,存储器ins't腾出一旦被卸载。

I have a large project built in as3. Part of its main functionality is to load and unload various as2 swfs. The problem is that the memory ins't free up once they are unloaded.

我有机会获得AS2主权财富基金code基地,摧毁了所有的对象,停了下来,杀了定时器,监听器,从舞台上删除,销毁所有已创建的MovieClip.protoypes。他们看起来是干净至于AS2调试器显示破坏函数运行后无残存的对象。在AS3中我已经关闭了本地连接,清理所有引用/监听到的AVM1Movie就跑Loader.unloadAndStop()。跟踪在柔性说,SWF被卸载但看着windows任务管理器中的内存使用量从未下降到时,它是被加载的AS2瑞士法郎前。每个AS2 SWF可以每次运行所以内存被吃掉了快速的加载时间长达80兆和卸载一些AS2文件。

I have access to the as2 swfs code base and destroyed all objects, stopped and killed timers, listeners, removed from stage, destroyed all the MovieClip.protoypes that were created. They look to be clean as far as the AS2 debugger show no remnants of the object after the destroy function is run. In AS3 i've closed the local connection, cleaned all references/listeners to the AVM1Movie and ran Loader.unloadAndStop(). The trace out in flex says the swf was unloaded but looking at windows task manager the memory usage never drops to when it was before the as2 swf was loaded. Each as2 swf can take up to 80 megs each time it's run so memory gets eaten up fast and loading and unloading a few as2 files.

在这一点上,如果AS2主权财富基金被卸载,我可以假设,可以留待是MovieClip.prototype唯一和/或_global,_root变量在AS2的运行时间增加。但我通过这些了,找不到其他任何可能被粘。有没有人见过的问题之前,该AVM1机不能释放内存?

At this point if the AS2 swfs are unloaded the only thing that I can assume that could be left is MovieClip.prototype and/or _global, _root variables add during the AS2's run time. But i've gone through those and can't find anything else that might be sticking. Has anyone ever seen problems before with the AVM1 machine not freeing up its memory?

推荐答案

我想你应该阅读这些文章格兰特斯金纳:

I think you should read these articles by Grant Skinner:

http://gskinner.com/blog/archives/2006/06/ as3_resource_ma.html

http://gskinner.com/blog/archives/2006/07/ as3_resource_ma_1.html

http://gskinner.com/blog/archives/2006/08/ as3_resource_ma_2.html

在第二个,第问题2:加载内容真指出您的问题

In the second one , section Issue 2: Loaded Content really points out your issue.