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.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Horcrux7
  • 23,758
  • 21
  • 98
  • 156

7 Answers7

10

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

MvG
  • 57,380
  • 22
  • 148
  • 276
jsight
  • 27,819
  • 25
  • 107
  • 140
  • 3
    "The new plugin architecture in JDK6u10 supports this, but obviously thats only at the RC stage right now." It's out now. :) – hishadow Nov 25 '08 at 20:35
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...

paul
  • 13,312
  • 23
  • 81
  • 144
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" /"
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Mayur
  • 21
  • 1
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/

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.

Jason Kealey
  • 7,988
  • 11
  • 42
  • 55
-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/

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

Liedman
  • 10,099
  • 4
  • 34
  • 36
  • 1
    the link you say "You can always check" is dead - http://forums.sun.com/thread.jspa?threadID=523105&messageID=3033288 – gnat Oct 13 '11 at 12:19