使用separate_jvm 在单个JVM 中启动小程序并不总是有效 [英] Using separate_jvm to start applet in individual JVMs not always working

查看:36
本文介绍了使用separate_jvm 在单个JVM 中启动小程序并不总是有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个占用相当多内存的小程序,所以我们希望以separate_jvm = true 启动它,以便每个实例都有自己的JVM(而不是共享的),这样我们就不会在重复时耗尽内存调用.这适用于我们的开发盒,但在我们客户的计算机上失败.

I have an applet that takes a fair amount of memory so we want to start it with separate_jvm = true so that each instance gets its own JVM (rather than a shared one) so we don't run out of memory upon repeated invocations. This works on our development boxes, but fails on our clients' computers.

这样做有安全原因吗?

这是一个签名&值得信赖的小程序,因为我们正在做 3d 渲染.

This is a signed & trusted applet as we're doing 3d rendering.

推荐答案

我假设您的客户端计算机上安装了 Sun Java 6 update 10.如果没有,您可能会强制小程序 在版本至少为 6u10 的 JVM 中运行.我不确定将抛出的错误,或者如果找不到所需的 JVM 版本时显示的错误消息.

I would presume that Sun Java 6 update 10 is installed on your client's computers. If not, you could probably force the applet to run in a JVM whose version is atleast 6u10. I'm unsure about the error that will be thrown, or the error message displayed if the required version of the JVM is not found.

除此之外,无法保证在 separate_jvm 参数在 APPLET 标记中指定.

Apart from that, there is no guarantee that a separate JVM instance will be created when the separate_jvm parameter is specified in an APPLET tag.

唯一的保证是小程序将在与其他小程序分离的自己的 JVM 中运行.如果一个 JVM 已经可用,并且没有在该 JVM 中加载小程序,那么 JVM 有可能在已经初始化的 JVM 实例中加载小程序.

The only guarantee is that the applet will run in its own JVM separated from other applets. If a JVM is already available and if no applet has been loaded in that JVM, then it is possible for the JVM to load the applet in the already initialized JVM instance.

对于 Sun Java 6 u10 发行说明,以下要点值得一读:

For the Sun Java 6 u10 release notes, the following salient points are worth reading:

这里是一组粗略的指南,来自 6u10 发行说明,用于共享和创建新的 JVM 实例:

Here is a rough set of guidelines from the 6u10 release notes, for the sharing and creation of new JVM instances:

  • 如果用于启动预先存在的 JVM 实例的命令行参数是所请求参数的超集,则将使用预先存在的 JVM 实例.
  • 如果为默认"命令行参数集启动 JVM 实例(即,在 Java 控制面板中指定的那些,但未指定 java_arguments),则此 JVM 实例将永远不会用于启动任何小程序甚至有一个通过 java_arguments 指定的命令行参数.
  • -Xmx 是专门处理的:如果一个预先存在的 JVM 实例是通过 java_arguments 用 -Xmx256m 启动的,并且一个新的小程序请求 -Xmx128m,那么新的小程序很可能会在预先存在的 JVM 实例中运行.换言之,-Xmx 规范与大于或等于测试相匹配.

因此,最好的办法是在 applet 标签中提供 java_arguments,这样就很有可能在单独的 JVM 中启动 applet.

The best bet therefore is to provide java_arguments in the applet tag, such that there is a very high probability of launching the applet in a separate JVM.

这篇关于使用separate_jvm 在单个JVM 中启动小程序并不总是有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆