闪存精简版内存管理

发布于 2024-07-25 20:03:36 字数 194 浏览 3 评论 0原文

我很难在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

为你鎻心 2024-08-01 20:03:37

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文