ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [PATCH] Less memory consumption for subbuilds
Date Fri, 21 Jul 2000 10:46:03 GMT
>>>>> "gm" == glennm  <> writes:

 gm> Also, the execute method now has a try/finally block to ensure
 gm> the subproject p1 is set to null so it can be GC'ed (thanks for
 gm> pointing that out Conor).

This approach has a serious problem. It relies on the fact that a
particular instance of a task will be executed once and only once -
this might not be true.

If you've given an id to the task, this one can be referenced via
Project.getReferences() and nothing is stopping another task - be it a
script task or one written in Java - to invoke execute on it again.

What can we do about this? 

(1) Check whether there is a reference to this instance (or the
surrounding target) and only null p1 if there isn't?

(2) Put a disclaimer into the docs saying "Ant tasks may only be
executed once"?

(3) Don't drop the reference to p1?

I'd prefer (1).


View raw message