闪存精简版内存管理
我很难在 flash lite 中管理我的内存。 有什么我应该关心的指示吗? 或最佳实践?
我每 60 秒就会读取一次垃圾收集器运行的数据。
我正在删除我的对象/影片剪辑,例如
mc = null; 删除MC;
并确保所有听众都被删除。
还是什么都没有发生..
I'm having a hard time managing my memory in flash lite.
are there any pointers i should care about ? or best practices?
ive been reading every 60 seconds the garbage collector runs.
i'm deleting my objects/movieclips like
mc = null;
delete mc;
and making sure every listeners is deleted on it.
still nothing seems to happen..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flash 的垃圾收集器不是确定性的 - 它会在可以运行时运行,虽然它可能会定期检查是否可以运行,但不能保证它会运行。 如果您的 SWF 不断占用 CPU,GC 将永远没有时间运行。
Flash Lite 使用 ActionScript 2,它为视觉资源提供了一个“nuke”选项 - MovieClip.unloadMovie()。 如果您有一个影片剪辑,对其运行卸载将会杀死其中的所有内容。
Flash's garbage collector isn't deterministic - it runs when it can run and while it may check to see if it can run at a regular interval, there's no guarantee it will run. If your SWF is constantly chewing CPU the GC will never have time run.
Flash Lite uses ActionScript 2 which does have one "nuke" option for visual assets - MovieClip.unloadMovie(). If you've got a movieclip, running unload on it will kill everything within it.