Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2005

Tip: Looking for answers? Try searching our database.

ANT, ANT_OPTS and heap size

Thread view: 
No Such Luck - 26 Aug 2005 13:35 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.