When I build my Java application as a Frame-derived class, I start the JVM with the switches
-Xmx512m -Xms128m
in order to provide sufficient heap space to this memory-intesive application.
I also host this application within a web page, by building it with its main class derived from Applet instead of Frame. In this case, I'd like to set the memory parameters either programatically (within the applet), or on the APPLET tag in my HTML.
When I build my Java application as a Frame-derived class, I start the JVM with the switches
-Xmx512m -Xms128m
You can't do this on a per-applet basis. You can set it for the entire VM that's loaded in the browser, by using the "Java Plug-In Control Panel". Under the "Advanced" tab, there's a box for "Java runtime parameters".
But then, this will apply to all applets, even the trivial ones you see on many websites.. The -Xms, especially, will result in a bloated VM for every applet.
You could try leaving out the -Xms (i.e. use the default), and only specify the -Xmx. That'll provide you a satisfactory compromise, I think..
Re: Setting Java heap size parameters in Applet, or on Applet tag
May 18, 2004 8:57 AM
(reply 3
of 6) (In reply to
#2 )
When I build my Java application as a Frame-derived
class, I start the JVM with the switches
-Xmx512m -Xms128m
You can't do this on a per-applet basis.
To be clear, it is not possible for the applet/page to do this. It has be done manually on the client PC (or at least in such a way that is outside of the VM itself.)
Re: Setting Java heap size parameters in Applet, or on Applet tag
Feb 15, 2005 9:43 AM
(reply 6
of 6) (In reply to
#5 )
Is this true for all Java Runtime Parameters? That is, is there any way to use command line arguments on a per-applet basis, or do they all have to be set manually on the client?
I'm thinking of "-Dapple.awt.textantialiasing=on", if it matters.