You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by aubie au <au...@yahoo.com> on 2005/11/04 00:54:03 UTC

Problem using ant, subant for Big Projects

This might be a common problem you might have seen.
My project structure is like this.

main/
    build.xml
    config/common-targets.xml
    sub1/build.xml
    ....... 
    subN/build.xml

In common-targets.xml, I have my own taskdef like this
<taskdef name="customizer"
classname="com.foo.Customizer">
	<classpath refid="build.classpath"/>
</taskdef>

Each subN/build.xml has something like this
<target name="build">
    <customizer>
      .......
     <customizer>
</target>

In main/build.xml, I call the build targets of all
subN using ant task(I tried subant task also).
The problem is, when I run all subN from
main/build.xml, ant creates a separate classloader
(AntClassLoader2) each time i call <customizer> task.
This is never GCed throught the execution of main
project although the particular subn is done, finally
running out of memory.
If i execute 10 subN build targets from
main/build.xml, atleast 10 to 15 AntClassLoaders are
created.

I cannot refer to the common-targets.xml in
main/build.xml, as i want flexibility to run the
targets from main/build.xml or subN/build.xml

Is there any solution or kind of structure i can i 
use to get around this problem.

I appreciate any quick response.

thanks,
aubie


           



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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


Re: Problem using ant, subant for Big Projects

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 4 Nov 2005, aubie au <au...@yahoo.com> wrote:

> I tried by defining by taskdef in a different way and
> it works now. In the task definition, I dont put
> classpath and start ant -lib $MY_LIB, it works fine.

>From Ant's point of view this is more or less the same.

> Does that mean taskdef implementation has a problem?

No, it means that either we have a memory leak that prevents
AntClassLoader instances from being collected - or it means the Java
VM needs some special encouragement in order to garbage collect
classloaders.

If throwing in some Java command line arguments fixes the situation, I
tend to believe the later is the case.

> I liked your articles,"New Ant 1.6 Features for Big
> Projects" & "Ant 1.6 for Task Writers", they are very
> informative.

Thanks

        Stefan

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


Re: Problem using ant, subant for Big Projects

Posted by aubie au <au...@yahoo.com>.
Hi Stefan,

Thanks for your quick response.
I tried by defining by taskdef in a different way and
it works now. In the task definition, I dont put
classpath and start ant -lib $MY_LIB, it works fine.

Does that mean taskdef implementation has a problem?
I can live with this annoyance for now, but this
problem makes ANT unscalable for big projects.

I liked your articles,"New Ant 1.6 Features for Big
Projects" & "Ant 1.6 for Task Writers", they are very
informative.

thanks,
Rama Pulavarthi
 


--- Stefan Bodewig <bo...@apache.org> wrote:

> On Thu, 3 Nov 2005, aubie au
> <au...@yahoo.com> wrote:
> 
> > In main/build.xml, I call the build targets of all
> > subN using ant task(I tried subant task also).
> > The problem is, when I run all subN from
> > main/build.xml, ant creates a separate classloader
> > (AntClassLoader2) each time i call <customizer>
> task.
> > This is never GCed throught the execution of main
> > project although the particular subn is done,
> finally
> > running out of memory.
> 
> I think you've hit
>
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33061>
> which also
> mentions a few workarounds.
> 
> Even though I've assigned the bug to myself I failed
> to find time to
> fully research the issue yet.  If
> -XX,+AggressiveHeap really helps,
> this seems to be more of a JVM than an Ant issue.
> 
> Stefan
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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


Re: Problem using ant, subant for Big Projects

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 3 Nov 2005, aubie au <au...@yahoo.com> wrote:

> In main/build.xml, I call the build targets of all
> subN using ant task(I tried subant task also).
> The problem is, when I run all subN from
> main/build.xml, ant creates a separate classloader
> (AntClassLoader2) each time i call <customizer> task.
> This is never GCed throught the execution of main
> project although the particular subn is done, finally
> running out of memory.

I think you've hit
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33061> which also
mentions a few workarounds.

Even though I've assigned the bug to myself I failed to find time to
fully research the issue yet.  If -XX,+AggressiveHeap really helps,
this seems to be more of a JVM than an Ant issue.

Stefan

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