How can I start an Java applet with more memory?
Asked Answered
L

7

13

The default 64 MB max heap memory can be small for a large Java application. Are there any applet parameter to increment this for a signed applet?

For a Java program this is a simple command line parameter but how this work for an applet in the browser.

Lecturer answered 19/9, 2008 at 13:55 Comment(1)
You need to be a bit more specific about the environment you are running in.Poteet
B
10

The new plugin architecture in JDK6u10 supports this. Prior to that, the only way to do it was in the Java control panel.

Beadledom answered 19/9, 2008 at 14:55 Comment(1)
"The new plugin architecture in JDK6u10 supports this, but obviously thats only at the RC stage right now." It's out now. :)Aforethought
T
5

Use the JavaConsole -> Java -> Java Applet Runtime settings to define the initial and maximum memory allocation (using -Xms128 -Xmx512 or similar).

I understand that newer versions of Java (6?) allow the developer some influence over these settings but I haven't been there yet...

Theatre answered 19/9, 2008 at 14:7 Comment(0)
H
2

Add to the JNLP file the below lines in "resources"

j2se version="1.6+" initial-heap-size="256m" max-heap-size="1024m"
    href="http://java.sun.com/products/autodl/j2se" /"
Hirsch answered 10/11, 2010 at 21:24 Comment(0)
R
1

Actually, starting the applet inside Java Web Start (JNLP) lets you specify the same memory constraints that you would for a conventional Java application. (Xms and Xmx).

JNLP supports applets by default, so no code changes are required in most cases.

Rainbolt answered 9/10, 2008 at 13:28 Comment(1)
The problem with JNLP is that you can not start the application embedded in the html page.Lecturer
K
1

There is possibility to change this value, by setting paramether in example It works since java1.6.0_10 details at https://jdk6.dev.java.net/plugin2/

Kurtz answered 5/8, 2009 at 7:23 Comment(0)
P
-1

It can be done through a couple of ways:

i) By either increasing the Xms, Xmx and Xmn values along with MaxPermSize java arguments in java control panel; and/or

ii) by adding a java_arguments PARAM tag to OBJECT tag in jsp/html:

This link throws more light on this: http://technoguider.com/2015/06/memory-requirements-for-an-applet/

Perimorph answered 11/6, 2015 at 11:52 Comment(0)
H
-3

Not that I know for certain, it's been a long time since I wrote applets, but I don't think you can set this from the applet.

Apparently, you can set the JVM's heap size for the browser's JVM from the Java plug-in control panel, but that's something the user has to do before starting your applet.

You can always check http://forums.sun.com/thread.jspa?threadID=523105&messageID=3033288 for more discussion on the topic.

Hillaryhillbilly answered 19/9, 2008 at 14:6 Comment(1)
the link you say "You can always check" is dead - forums.sun.com/…Salita

© 2022 - 2024 — McMap. All rights reserved.