This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes Can I set JVM memory size when running applets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can I set JVM memory size when running applets?" Watch "Can I set JVM memory size when running applets?" New topic
Author

Can I set JVM memory size when running applets?

Sang-Wook Kim
Ranch Hand

Joined: Jan 07, 2004
Posts: 36
Hi,

I have downloaded an applet that renders images and I have

a problem with Java memory. I remember that default maximum

size that applet can use is 70MB, and the problem is 70MB is

not enough when rendering big images. It is OK when I add

"-Xmx -Xms" parameters in the Java Control but I cannot tell

everyone who wants to see my images to go control panel, add

parameters etc..

So my question is...

Is it possible add "-Xmx -Xms" parameters inside the applet file

so that these parameters run automatically when executing applet?

Thanks in advance for your reply!

Hyung
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41132
    
  45
No, the applet and its tag have no control over those settings. That could be used for denial-of-service attacks: imagine the page setting the JVM to take as much memory as the system has, and then using it all up.


Ping & DNS - my free Android networking tools app
Sang-Wook Kim
Ranch Hand

Joined: Jan 07, 2004
Posts: 36
Is there any other way to solve this memory issue?
Ashok Mor
Ranch Hand

Joined: Jul 17, 2007
Posts: 44
Hi Sang-Wook Kim ,

You can do it while splitting an image into number of spices and take each spices in diff diff Canvas, and finally put them over an Applet.


Ashok Mor.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can I set JVM memory size when running applets?
 
Similar Threads
heap space setting for Tomcat on Linux
Running java jar with ram of 2GB
PERM, -Xms and -Xmx
Memory Managment
OutOfMemoryError