You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Na...@epiphany.com on 2001/12/08 08:40:43 UTC

OutOfMemoryError with Ant 1.4.1 and Tomcat 3.2.1

Hi,

I just recently upgraded from Ant 1.3 to Ant 1.4.1. I am now consistently
getting OutOfMemoryError exceptions when building a large java project with
<javac> on Unix machines through Ant 1.4.1 and Tomcat 3.2.1. I am using
Tomcat for our Servlet-based build application, which allows users to kick
off builds on various machines through HTTP requests. I do not encounter the
out of memory error when invoking Ant and building the projects from the
command line. I also do not encounter the out of memory error when building
through Ant 1.3 and Tomcat 3.2.1.

I have read through the mailing list and FAQs and tried implementing many of
the helpful suggestions for fixing OutOfMemoryError exceptions, including
varying and increasing the heap size through the ANT_OPTS environment
variable and <javac> memoryMaximumSize attribute, but none of them seem to
work. I have also tried passing more memory to the JVM when starting Tomcat
using the TOMCAT_OPTS variable. The ANT_OPTS and memoryMaximumSize attribute
syntaxes I'm using are:

setenv ANT_OPTS "-Xms128m -Xmx512m"

<javac srcdir="${SharedSourceDir}" destdir="${SharedDeployDir}"
debug="${debug}" memoryMaximumSize="512m">
  <classpath refid="project.class.path"/>
  <exclude name="Web/**/*.*"/>
  <exclude name="ejbcgen/**/*.*"/>
</javac>

Please note that I'm not using fork="yes" in the <javac> task because I
thought it was no longer required in Ant 1.4.1. Please correct me if I'm
wrong in interpreting this fix in the WHAT'S NEW documentation.

I would really like to stick with Ant 1.4.1 as it provides the parallel
processing that is needed in building other projects.

Thank you very much in advance to everyone who can help me resolve this
issue.

-Nathan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: OutOfMemoryError with Ant 1.4.1 and Tomcat 3.2.1

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: <Na...@epiphany.com>
To: <an...@jakarta.apache.org>
Sent: Friday, December 07, 2001 11:40 PM
Subject: OutOfMemoryError with Ant 1.4.1 and Tomcat 3.2.1


> Hi,
>
> I just recently upgraded from Ant 1.3 to Ant 1.4.1. I am now consistently
> getting OutOfMemoryError exceptions when building a large java project
with
> <javac> on Unix machines through Ant 1.4.1 and Tomcat 3.2.1. I am using
> Tomcat for our Servlet-based build application, which allows users to kick
> off builds on various machines through HTTP requests. I do not encounter
the
> out of memory error when invoking Ant and building the projects from the
> command line. I also do not encounter the out of memory error when
building
> through Ant 1.3 and Tomcat 3.2.1.
>

> <javac srcdir="${SharedSourceDir}" destdir="${SharedDeployDir}"
> debug="${debug}" memoryMaximumSize="512m">
>   <classpath refid="project.class.path"/>
>   <exclude name="Web/**/*.*"/>
>   <exclude name="ejbcgen/**/*.*"/>
> </javac>
>
> Please note that I'm not using fork="yes" in the <javac> task because I
> thought it was no longer required in Ant 1.4.1. Please correct me if I'm
> wrong in interpreting this fix in the WHAT'S NEW documentation.

you probably need to set the fork variable, as otherwise a new JVM wont get
created for javac with extra memory.

Also, try jikes as a compiler.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: OutOfMemoryError with Ant 1.4.1 and Tomcat 3.2.1

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 7 Dec 2001, Nathan Tran <Na...@epiphany.com> wrote:

> <javac srcdir="${SharedSourceDir}" destdir="${SharedDeployDir}"
> debug="${debug}" memoryMaximumSize="512m">
>   <classpath refid="project.class.path"/>
>   <exclude name="Web/**/*.*"/>
>   <exclude name="ejbcgen/**/*.*"/>
> </javac>
> 
> Please note that I'm not using fork="yes" in the <javac> task
> because I thought it was no longer required in Ant 1.4.1.

If you don't set fork="yes", the memory settings will be ignored,
instead of causing a build failure, this is all that has been changed.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>