Home arrow static arrow Java Programming [Archive] - java.lang.OutOfMemoryError in ANT
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - java.lang.OutOfMemoryError in ANT
This topic has 4 replies on 1 page.

Posts:45
Registered: 10/2/02
java.lang.OutOfMemoryError in ANT  
Jun 17, 2004 11:18 AM



 
Hi,
I am running an ANT script which creates a large pdf document (amongst other things) but it keeps failing due to an OutOfMemoryError. Is there anyway of increasing the amount of memory the compiler in ANT has? Or is there a better way around this?
 

Posts:19,725
Registered: 9/26/01
Re: java.lang.OutOfMemoryError in ANT  
Jun 17, 2004 11:28 AM (reply 1 of 4)



 
Hi,
I am running an ANT script which creates a large pdf
document (amongst other things) but it keeps failing
due to an OutOfMemoryError. Is there anyway of
increasing the amount of memory the compiler in ANT
has? Or is there a better way around this?

Edit the ant script (ant.bat or ant.sh, etc depending on what platform you're running this on)
 

Posts:45
Registered: 10/2/02
Re: java.lang.OutOfMemoryError in ANT  
Jun 17, 2004 11:36 AM (reply 2 of 4)



 
I know you can set the amount of memory the javac compiler uses using the memoryInitialSize attribute of javac in ANT. I thought about this but the this task in the ant script does not actually call up javac or any other compiler :

<target name="pdf" depends="init">
<pdfdoc
url="jdbc:odbc:ObjectToolkit${arg2}"
driverClass="sun.jdbc.odbc.JdbcOdbcDriver"
xsl="docs\pdf\pdf.xsl"
kernel="${version}"
output="bin\ObjectToolkitSummary(${version}).pdf"
type="summary"
/>
<pdfdoc
url="jdbc:odbc:ObjectToolkit${arg2}"
driverClass="sun.jdbc.odbc.JdbcOdbcDriver"
xsl="docs\pdf\pdf.xsl"
kernel="${version}"
output="bin\ObjectToolkit(${version}).pdf"
type="all"
/>
</target>
So im not to sure whats running out of memory. Is there anyway of increasing the amount of memory the virtual machine uses?
 

Posts:19,725
Registered: 9/26/01
Re: java.lang.OutOfMemoryError in ANT  
Jun 17, 2004 11:45 AM (reply 3 of 4)



 
I know you can set the amount of memory the javac
compiler uses using the memoryInitialSize attribute of
javac in ANT. I thought about this but the this task
in the ant script does not actually call up javac or
any other compiler :

<target name="pdf" depends="init">
<pdfdoc
url="jdbc:odbc:ObjectToolkit${arg2}"
driverClass="sun.jdbc.odbc.JdbcOdbcDriver"
xsl="docs\pdf\pdf.xsl"
kernel="${version}"
output="bin\ObjectToolkitSummary(${version}).pdf"
type="summary"
/>
<pdfdoc
url="jdbc:odbc:ObjectToolkit${arg2}"
driverClass="sun.jdbc.odbc.JdbcOdbcDriver"
xsl="docs\pdf\pdf.xsl"
kernel="${version}"
output="bin\ObjectToolkit(${version}).pdf"
type="all"
/>
</target>
So im not to sure whats running out of memory. Is
there anyway of increasing the amount of memory the
virtual machine uses?

I'm not familiar with the <pdfdoc> task, but I wonder if ANT is running it inside the VM that ANT is running within. Hence, my suggestion to edit the ant script still applies as something you can investigate.
Somewhere in that ant script it does this:
java -classpath ... org.apache.Ant (or whatever the Ant main class is called)
That's where you can add/change the -Xmx command-line option affecting java's memory allocation.
 

Posts:45
Registered: 10/2/02
Re: java.lang.OutOfMemoryError in ANT  
Jun 17, 2004 1:05 PM (reply 4 of 4)



 
Thanks for pointing me in the right direction. Ill take a look into the pdfdoc task and see if there is anything i can change in that.
 
This topic has 4 replies on 1 page.