costin 2002/11/21 14:40:45
Modified: proposal/embed/src/java/org/apache/tools/ant
UnknownElement2.java
Log:
I hope this won't brake anything :-), but I need to try it.
Remove the reference to the task after the task execution.
Next time the task is called a new instance will be created.
This avoids excessive memory usage and potential leaks in large
programs. All the memory that is used by the task - i.e. the
task itself and all the object it creates - are beeing hold in
memory and prevented from GC by this reference.
I hope this will remove some OutOfMemory errors for large build
files.
Nicola - please let me know if you see any problems after this change !
Revision Changes Path
1.2 +3 -0
jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java
Index: UnknownElement2.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UnknownElement2.java 11 Oct 2002 17:57:56 -0000 1.1
+++ UnknownElement2.java 21 Nov 2002 22:40:45 -0000 1.2
@@ -198,6 +198,9 @@
if (realThing instanceof Task) {
((Task) realThing).execute();
}
+ // the task will not be reused ( a new init() will be called )
+ // Let GC do its job
+ realThing=null;
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>