Hi All:
I have a java applet that scans images using TWAIN. Depending on the
image options (dpi, color, etc), some combinations create a
java.lang.OutOfMemory heap error.
I am trying to set initial and max heap sizes by compiling the java
applet with ANT. I have read this is done by utilizing the -Xmx and
-Xms options in javac, and this is accomplished in ANT by using the
ANT_OPTS variable.
In ant.bat, I have tried specifying each of the following:
1) ANT_OPTS=
2) ANT_OPTS=-Xmx256m
3) ANT_OPTS=-Xmx128m
4) ANT_OPTS=-Xmx512m
5) ANT_OPTS=-Xms128m
6) ANT_OPTS=-Xms256m
7) ANT_OPTS=-Xms256m -Xmx256m
However, no matter what initial or max heap sizes I specify, the result
of printing Runtime.getRuntime().maxMemory() at any point in the java
applet is always "99942400" (or ~96 MB).
Anyone have any idea what I can do to actually increase the heap size
of my java applet? Or how I can get my heap size options of 256M to
actually be recognized and used?
Thanks.
Andrew Thompson - 26 Aug 2005 14:22 GMT
> Anyone have any idea what I can do to actually increase the heap size
> of my java applet?
JWS.

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Your eyes, no surprise, are open wide.."
Divinyls 'Good Die Young'
No Such Luck - 26 Aug 2005 14:34 GMT
> > Anyone have any idea what I can do to actually increase the heap size
> > of my java applet?
>
> JWS.
Hmmm.. According to acronymfinder.com, JWS is either:
1) Joint Warfighting Space (DOD warfighter concept integrating
responsive space assets to battle theater)
2) Joint Work Statement
I'm guessing you mean neither of these. Could you elaborate?
Thanks.
Andrew Thompson - 26 Aug 2005 14:53 GMT
>>> Anyone have any idea what I can do to actually increase the heap size
>>> of my java applet?
[quoted text clipped - 9 lines]
>
> I'm guessing you mean neither of these.
Good (correct) guess, but..
>...Could you elaborate?
..'less good' choice of search* strategy, try mine.
<http://onesearch.sun.com/search/onesearch/index.jsp?col=dev-reference&charset=ut
f-8&qt=jws>
In a nutshell. Java Web Start..
<http://www.physci.org/codes/javafaq.jsp#jws>
* Note that started at the 'search' box here..
<http://java.sun.com>
HTH

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"..When after all, it was you and me."
The Rolling Stones 'Sympathy For The Devil'
Raymond DeCampo - 27 Aug 2005 03:15 GMT
> Hi All:
>
[quoted text clipped - 6 lines]
> -Xms options in javac, and this is accomplished in ANT by using the
> ANT_OPTS variable.
These are runtime switches, not compile time switches. As Andrew has
already noted, Java Web Start can help.
If the applet is just for private use, you can adjust the JVM options to
the Java Plug-in using the control panel.
HTH,
Ray

Signature
XML is the programmer's duct tape.