ANT, ANT_OPTS and heap size

N

No Such Luck

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

No Such Luck

Andrew said:

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

Andrew Thompson

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.

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=utf-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
 
R

Raymond DeCampo

No said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top