Skip to content

Applet: Java heap space

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

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

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 ?



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">

Here more information

User contributions licensed under: CC BY-SA
6 People found this is helpful