使用 SWFLoader 的 RSL 嵌套 Flex 应用程序的内存消耗?

发布于 2024-07-14 14:00:41 字数 611 浏览 8 评论 0原文

这些天我读了很多关于 RSL 的内容。 一个缺点是 RSL 必须加载到内存中,但可以节省大量加载时间。

现在,在以下场景中会发生什么:

我有一个 superFramework.swf 和一个 subapp.swf。 subapp.swf 使用 SWFLoader 在 superframework.swf 中按需显示和加载。 但是,这两个 SWF 都依赖于 common.swc,该文件将被编译为 RSL。

所以依赖关系看起来像这样:

superframework.swf           ---RSL---> common.swc
   ---SWFLoader-->subapp.swf ---RSL---> common.swc

现在我的问题:

  • subapp.swf 是否加载在单独的内存空间中?
  • 如果是:这是否意味着 common.swc RSL 被加载到内存中两次?
  • 如果不是:那么像 common.swc 中的 ModelLocator 这样的单例呢? subapp.swf 和 superframework.swf 是否可以同时使用同一个实例?

these days I read a lot with regards to RSLs. One disadvantage is that RSLs must be loaded into memory but can save significant loading time.

Now what happens in the following scenario:

I have a superFramework.swf and a subapp.swf. subapp.swf is displayed and loaded on demand within superframework.swf using the SWFLoader. However both SWFs have dependencies to the common.swc, which will be compiled as RSL.

So the dependcies look like this:

superframework.swf           ---RSL---> common.swc
   ---SWFLoader-->subapp.swf ---RSL---> common.swc

Now my questions:

  • Is the subapp.swf loaded in a separate memory space?
  • If yes: Does this mean that the common.swc RSL is loaded twice into memory?
  • If no: What about singletons like a ModelLocator in the common.swc. Is the same instance available to subapp.swf and superframework.swf at the same time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

半世蒼涼 2024-07-21 14:00:41

RSL 不是真正的动态库。 它们更像是在运行时静态链接整个库。

  • subapp.swf 是否加载到单独的内存空间中?

是的,有点像。 所有 SWF 都在 Flash Player 中运行。 出于安全原因,他们有自己的小沙箱。

  • 如果是:这是否意味着 common.swc RSL 被加载到内存中两次?

是的,每个调用应用程序都会加载给定 RSL 的一份副本。

  • 如果不是:那么像 common.swc 中的 ModelLocator 这样的单例呢? subapp.swf 和 superframework.swf 是否可以同时使用同一个实例?

不,他们会有不同的情况。

RSL 有助于减小可分发文件的大小。 但这并不一定总是一个优势。 我建议您先浏览页面飞跃。

RSLs are not true dynamic libraries. They are more like static linking the entire library at runtime.

  • Is the subapp.swf loaded in a separate memory space?

Yes, sort of. All SWFs run in the Flash Player. They have their own little sandboxes for security reasons.

  • If yes: Does this mean that the common.swc RSL is loaded twice into memory?

Yes, each calling application loads one copy of a given RSL.

  • If no: What about singletons like a ModelLocator in the common.swc. Is the same instance available to subapp.swf and superframework.swf at the same time?

No, they will have different instances.

RSLs help reduce the distributable's size. But this is not necessarily an advantage always. I suggest you go through this page before taking a leap.

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