问题描述
我已经知道了基于时间表编程的所有问题,但我很好奇,想知道发生了什么垃圾收集器在这种情况下。
I already know all the problems in programming based on timeline, but I'm curious to know what happens to garbage collector in that situation.
谈起code的时间表 - 作为一个影片剪辑是无法访问的,如果code是不是在同一个框架,因为它,这是否引起了内存泄漏的可能性。
Talking about code in timeline - as a movieclip isn't accessible if the code isn't in the same frame as it, does this raises the possibility of memory leak?
在我看来,在时间轴中的影片剪辑被添加在播放头是目前它的框架,并取消当它熄灭。
Seems to me that the movieclips in timeline are added when the "playhead" currently is on it's frame, and removed when it goes out.
推荐答案
垃圾收集器将无法清洗/处理影片剪辑从舞台上删除,如果:
The Garbage Collector will not be able to clean/dispose a movie clip removed from stage if:
-
这片段还在玩和做的东西(创建/删除其他的东西......)
that clip is still playing and does stuff (create/remove other things...)
这是剪辑还是其他一些实例,它是到达引用
that clip is still referenced by some other instance that is "reachable"
您试图删除的方法太复杂的层次结构包含的项目太多[我没有任何号码,但我猜大约2 ^ 32项?]
you try to remove a way too complicated hierarchy containing too many items [I dont have any number for this, but I'd guess around 2^32 items?]
我一般用它来查看是否有内存泄漏的方法之一是在FlashDevelop中和GC动力运行的SWF Profiler来在某些情况下运行,看看被删除。
One way I usually use to see if there is a memory leak is to run SWF Profiler in FlashDevelop and force GC to run at certain situations and see what gets deleted.
请检查下面的文章的详细信息:
Please check following article for more information:
http://active.tutsplus.com/tutorials/workflow/quick-tip-understanding-garbage-collection-in-as3/
这篇关于什么垃圾收集器,当你有一个影片剪辑成一帧,而你的电影不断地结束并返回到开头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!