小程序:Java堆空间 [英] Applet: Java heap space

查看:138
本文介绍了小程序:Java堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于一个小错误执行,我发现我的速度有多快可以达到一个Java堆空间的问题。

Due to a small implementation mistake I discovered how quickly I could reach a Java heap space issue

现在的错误是固定的一切都很好,但它确实让我寻找到如何解决这一点,我foudn多种解决方案,如

now the bug is fixed everything is fine but it did get me looking into how to solve this and I foudn multiple solution such as

Java的-Xms5m -Xmx15m MyApp的

java -Xms5m -Xmx15m MyApp

问题是,这改变了我的计算机上的Java内存,但我正在上会在webrowser中使用的小程序。

the problem is that this changes the java memory on my computer, but I'm working on a Applet that is going to be used in a webrowser.

因此​​,有没有办法,在运行时的小程序来更改堆大小?

Therefore, is there a way, at RUNTIME in an APPLET to change the heap size ?

推荐答案

您可以参数添加到Applet标记。但是,你有兴趣的参数仅在U10的Java6或更高版本。

You can add parameters to the applet tag. But the parameter you are interested on is available only on Java6 u10 or later.

例如:

<APPLET archive="my_applet.jar" code="MyApplet" width="300" height="300">
    <PARAM name="java_arguments" value="-Xmx256m">
</APPLET>

下面的详细信息<一个href=\"http://www.oracle.com/technetwork/java/javase/plugin2-142482.html#JAVA_ARGUMENTS\">http://www.oracle.com/technetwork/java/javase/plugin2-142482.html#JAVA_ARGUMENTS

这篇关于小程序:Java堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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