participate


Java Virtual Machine (JVM) - Setting Java heap size parameters in Applet, or on Applet tag
<<   Back to Forum  |   Give us Feedback
This topic has 6 replies on 1 page.
greg_hassett
Posts:6
Registered: 11/21/03
Setting Java heap size parameters in Applet, or on Applet tag   
May 17, 2004 11:35 AM

 
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.

Anyone know how to do this?

Thanks ...
 
jschell
Posts:38,148
Registered: 11/3/97
Re: Setting Java heap size parameters in Applet, or on Applet tag   
May 17, 2004 12:16 PM (reply 1 of 6)  (In reply to original post )

 
I am rather certain it is not possible.
 
shankar.unni
Posts:749
Registered: 6/23/98
Re: Setting Java heap size parameters in Applet, or on Applet tag   
May 17, 2004 1:49 PM (reply 2 of 6)  (In reply to original post )

 
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..
 
jschell
Posts:38,148
Registered: 11/3/97
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.)
 
mirceapop
Posts:9
Registered: 4/8/01
Re: Setting Java heap size parameters in Applet, or on Applet tag   
Jan 17, 2005 2:59 AM (reply 4 of 6)  (In reply to #2 )

 
Hi,
where can I set the appleyt heap parameters on MAC OSX ? Is there a java control panel like widows has?
Thanks
 
Peter-Lawrey
Posts:6,487
Registered: 5/5/04
Re: Setting Java heap size parameters in Applet, or on Applet tag   
Jan 17, 2005 3:20 AM (reply 5 of 6)  (In reply to #4 )

 
If you ahve an applet which needs more than 64 MB, I would suggest you look at your design again. Applets are designed to be small simple programs.
 
kcptmolly
Posts:1
Registered: 2/14/05
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.
 
This topic has 6 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 28
  • Guests : 133

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums