问题描述
由于一个小错误执行,我发现我的速度有多快可以达到一个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内存,但我正在上会在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>
下面的详细信息http://www.oracle.com/technetwork/java/javase/plugin2-142482.html#JAVA_ARGUMENTS
这篇关于小程序:Java堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!