You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kenneth Litwak <kl...@apu.edu> on 2006/12/07 17:58:35 UTC

OutofMemoryError during compile target

  I don't know if this is related as such to ant, but I use ant to build
projects, so I'm posting here in case anyone has a suggestion. =20

   I have been building an application using ant on jdk 1.4.2 for about
2.5 years. No problem. Today I'm getting the error during compilation

[javac] java.lang.OutOfMemoryError


   I compiled just yesterday afternoon and did not get this error.
Here's what I did differently.
1. The application requires several jar files that it takes from a
repository.
2. Two of the jar files it needs, however, go into a lib directory of
the web app I'm trying to build.
3. I modified a properties file so that the application would get the
two jars from the same repository as everything else. Then, I'm simply
doing ant clean compile war

    This shows me messages that jar files, including the two problem jar
files, are fetched. However, the jar file that has the first problem
during compilation is 47K in the repository but only about 900 bytes in
the lib directory of the application.

     Examining the memory of the Linux server that the compile is
running on, there appears to be nothing significant using memory, and as
I said, I've been able to do the same compilation for over two years
without a problem. What might be going on? It's not just an issue of
using compiler flags for more memory (and exactly how to pass those to
the ant command I haven't figured out). Any suggestions? We're all stuck
on this.=20

  The error happens during the compile step:
<target name=3D"compile" depends=3D"init">
        <mkdir dir=3D"${build.dir}/classes"/>
      <javac srcdir=3D"${src.dir}"
           destdir=3D"${build.dir}/classes"
            debug=3D"${compile.debug}"
        deprecation=3D"${compile.deprecation}"
          optimize=3D"${compile.optimize}">
         <classpath refid=3D"project.classpath"/>
        </javac>
    </target>
The compile output identifies the "optimize" line as where the error is
but I assume that this is just the end of the compile command. =20

  Does anyone have a suggestion for what I might try to figure out how
to resolve or figure out this sudden, new problem on a process that has
been working fine?=20

  Also, if I wanted to try to specify more memory during the compile,
though I'm doubtful it will, help, how would I specify that for ant? I
know how to do it for a straightforward compile with javac.  Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: OutofMemoryError during compile target

Posted by Kenneth Litwak <kl...@apu.edu>.
Thanks Scot. No, I'm afraid the file system has lots of room.

Ken

-----Original Message-----
From: Scot P. Floess [mailto:floess@mindspring.com] 
Sent: Thursday, December 07, 2006 9:07 AM
To: Ant Users List
Subject: Re: OutofMemoryError during compile target

Is your file system full by chance?

I can't seem to locate the arguments to increase memory for javac...  If

I can find them I will reply back

Kenneth Litwak wrote:
>   I don't know if this is related as such to ant, but I use ant to
build
> projects, so I'm posting here in case anyone has a suggestion. =20
>
>    I have been building an application using ant on jdk 1.4.2 for
about
> 2.5 years. No problem. Today I'm getting the error during compilation
>
> [javac] java.lang.OutOfMemoryError
>
>
>    I compiled just yesterday afternoon and did not get this error.
> Here's what I did differently.
> 1. The application requires several jar files that it takes from a
> repository.
> 2. Two of the jar files it needs, however, go into a lib directory of
> the web app I'm trying to build.
> 3. I modified a properties file so that the application would get the
> two jars from the same repository as everything else. Then, I'm simply
> doing ant clean compile war
>
>     This shows me messages that jar files, including the two problem
jar
> files, are fetched. However, the jar file that has the first problem
> during compilation is 47K in the repository but only about 900 bytes
in
> the lib directory of the application.
>
>      Examining the memory of the Linux server that the compile is
> running on, there appears to be nothing significant using memory, and
as
> I said, I've been able to do the same compilation for over two years
> without a problem. What might be going on? It's not just an issue of
> using compiler flags for more memory (and exactly how to pass those to
> the ant command I haven't figured out). Any suggestions? We're all
stuck
> on this.=20
>
>   The error happens during the compile step:
> <target name=3D"compile" depends=3D"init">
>         <mkdir dir=3D"${build.dir}/classes"/>
>       <javac srcdir=3D"${src.dir}"
>            destdir=3D"${build.dir}/classes"
>             debug=3D"${compile.debug}"
>         deprecation=3D"${compile.deprecation}"
>           optimize=3D"${compile.optimize}">
>          <classpath refid=3D"project.classpath"/>
>         </javac>
>     </target>
> The compile output identifies the "optimize" line as where the error
is
> but I assume that this is just the end of the compile command. =20
>
>   Does anyone have a suggestion for what I might try to figure out how
> to resolve or figure out this sudden, new problem on a process that
has
> been working fine?=20
>
>   Also, if I wanted to try to specify more memory during the compile,
> though I'm doubtful it will, help, how would I specify that for ant? I
> know how to do it for a straightforward compile with javac.  Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: OutofMemoryError during compile target

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Is your file system full by chance?

I can't seem to locate the arguments to increase memory for javac...  If 
I can find them I will reply back

Kenneth Litwak wrote:
>   I don't know if this is related as such to ant, but I use ant to build
> projects, so I'm posting here in case anyone has a suggestion. =20
>
>    I have been building an application using ant on jdk 1.4.2 for about
> 2.5 years. No problem. Today I'm getting the error during compilation
>
> [javac] java.lang.OutOfMemoryError
>
>
>    I compiled just yesterday afternoon and did not get this error.
> Here's what I did differently.
> 1. The application requires several jar files that it takes from a
> repository.
> 2. Two of the jar files it needs, however, go into a lib directory of
> the web app I'm trying to build.
> 3. I modified a properties file so that the application would get the
> two jars from the same repository as everything else. Then, I'm simply
> doing ant clean compile war
>
>     This shows me messages that jar files, including the two problem jar
> files, are fetched. However, the jar file that has the first problem
> during compilation is 47K in the repository but only about 900 bytes in
> the lib directory of the application.
>
>      Examining the memory of the Linux server that the compile is
> running on, there appears to be nothing significant using memory, and as
> I said, I've been able to do the same compilation for over two years
> without a problem. What might be going on? It's not just an issue of
> using compiler flags for more memory (and exactly how to pass those to
> the ant command I haven't figured out). Any suggestions? We're all stuck
> on this.=20
>
>   The error happens during the compile step:
> <target name=3D"compile" depends=3D"init">
>         <mkdir dir=3D"${build.dir}/classes"/>
>       <javac srcdir=3D"${src.dir}"
>            destdir=3D"${build.dir}/classes"
>             debug=3D"${compile.debug}"
>         deprecation=3D"${compile.deprecation}"
>           optimize=3D"${compile.optimize}">
>          <classpath refid=3D"project.classpath"/>
>         </javac>
>     </target>
> The compile output identifies the "optimize" line as where the error is
> but I assume that this is just the end of the compile command. =20
>
>   Does anyone have a suggestion for what I might try to figure out how
> to resolve or figure out this sudden, new problem on a process that has
> been working fine?=20
>
>   Also, if I wanted to try to specify more memory during the compile,
> though I'm doubtful it will, help, how would I specify that for ant? I
> know how to do it for a straightforward compile with javac.  Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: OutofMemoryError during compile target

Posted by Kenneth Litwak <kl...@apu.edu>.
Thomas,

  I'm not very good at this ant script stuff.  Can you give a snippet of what this looks like? Thanks.

Ken

-----Original Message-----
From: Thomas Voigt [mailto:tv_spambox@gmx.de] 
Sent: Thursday, December 07, 2006 10:00 AM
To: Ant Users List
Subject: Re: OutofMemoryError during compile target


-------- Original-Nachricht --------
Datum:  Thu, 7 Dec 2006 08:58:35 -0800
Von: "Kenneth Litwak" <kl...@apu.edu>
An: user@ant.apache.org
Betreff:  OutofMemoryError during compile target

>   Does anyone have a suggestion for what I might try to figure out how
> to resolve or figure out this sudden, new problem on a process that has
> been working fine?

We had out of memory errors on and off when we used rather complicated ant scripts. Increasing the memory allocated to ant didn't help. However, after reducing the number of targets and antcalls in our scripts everything worked fine. 

>   Also, if I wanted to try to specify more memory during the compile,
> though I'm doubtful it will, help, how would I specify that for ant? I
> know how to do it for a straightforward compile with javac.  Thanks.

Try to add memory in the JAVA_OPTS and ANT_OPTS. We currently use -Xmx512M -Xms16M -XX:MaxPermSize=256m (which may be pretty generous, but it seems to work).

Regards, Thomas

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: OutofMemoryError during compile target

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Have you tried to run ant with verbosity turned on?

As in:

ant -v

Scot

Kenneth Litwak wrote:
> I tried memoryinitialsize="512m" in the javac task and that makes no difference.
>
> Ken
>
> -----Original Message-----
> From: Thomas Voigt [mailto:tv_spambox@gmx.de] 
> Sent: Thursday, December 07, 2006 10:00 AM
> To: Ant Users List
> Subject: Re: OutofMemoryError during compile target
>
>
> -------- Original-Nachricht --------
> Datum:  Thu, 7 Dec 2006 08:58:35 -0800
> Von: "Kenneth Litwak" <kl...@apu.edu>
> An: user@ant.apache.org
> Betreff:  OutofMemoryError during compile target
>
>   
>>   Does anyone have a suggestion for what I might try to figure out how
>> to resolve or figure out this sudden, new problem on a process that has
>> been working fine?
>>     
>
> We had out of memory errors on and off when we used rather complicated ant scripts. Increasing the memory allocated to ant didn't help. However, after reducing the number of targets and antcalls in our scripts everything worked fine. 
>
>   
>>   Also, if I wanted to try to specify more memory during the compile,
>> though I'm doubtful it will, help, how would I specify that for ant? I
>> know how to do it for a straightforward compile with javac.  Thanks.
>>     
>
> Try to add memory in the JAVA_OPTS and ANT_OPTS. We currently use -Xmx512M -Xms16M -XX:MaxPermSize=256m (which may be pretty generous, but it seems to work).
>
> Regards, Thomas
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


RE: OutofMemoryError during compile target

Posted by Kenneth Litwak <kl...@apu.edu>.
I tried memoryinitialsize="512m" in the javac task and that makes no difference.

Ken

-----Original Message-----
From: Thomas Voigt [mailto:tv_spambox@gmx.de] 
Sent: Thursday, December 07, 2006 10:00 AM
To: Ant Users List
Subject: Re: OutofMemoryError during compile target


-------- Original-Nachricht --------
Datum:  Thu, 7 Dec 2006 08:58:35 -0800
Von: "Kenneth Litwak" <kl...@apu.edu>
An: user@ant.apache.org
Betreff:  OutofMemoryError during compile target

>   Does anyone have a suggestion for what I might try to figure out how
> to resolve or figure out this sudden, new problem on a process that has
> been working fine?

We had out of memory errors on and off when we used rather complicated ant scripts. Increasing the memory allocated to ant didn't help. However, after reducing the number of targets and antcalls in our scripts everything worked fine. 

>   Also, if I wanted to try to specify more memory during the compile,
> though I'm doubtful it will, help, how would I specify that for ant? I
> know how to do it for a straightforward compile with javac.  Thanks.

Try to add memory in the JAVA_OPTS and ANT_OPTS. We currently use -Xmx512M -Xms16M -XX:MaxPermSize=256m (which may be pretty generous, but it seems to work).

Regards, Thomas

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: OutofMemoryError during compile target

Posted by Thomas Voigt <tv...@gmx.de>.
-------- Original-Nachricht --------
Datum:  Thu, 7 Dec 2006 08:58:35 -0800
Von: "Kenneth Litwak" <kl...@apu.edu>
An: user@ant.apache.org
Betreff:  OutofMemoryError during compile target

>   Does anyone have a suggestion for what I might try to figure out how
> to resolve or figure out this sudden, new problem on a process that has
> been working fine?

We had out of memory errors on and off when we used rather complicated ant scripts. Increasing the memory allocated to ant didn't help. However, after reducing the number of targets and antcalls in our scripts everything worked fine. 

>   Also, if I wanted to try to specify more memory during the compile,
> though I'm doubtful it will, help, how would I specify that for ant? I
> know how to do it for a straightforward compile with javac.  Thanks.

Try to add memory in the JAVA_OPTS and ANT_OPTS. We currently use -Xmx512M -Xms16M -XX:MaxPermSize=256m (which may be pretty generous, but it seems to work).

Regards, Thomas

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org