Browse Source

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 !


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273574 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 22 years ago
parent
commit
ae5f8603d5
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java

+ 3
- 0
proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java View File

@@ -198,6 +198,9 @@ public class UnknownElement2 extends UnknownElement {
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;
}

/**


Loading…
Cancel
Save