ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <>
Subject 1.7 Memory usage > 1.6.5 Memory usage
Date Wed, 19 Apr 2006 04:17:57 GMT
Just trying to reduce the amount of temporary objects created on the 
heap to resolve this OutOfMemory issue with AppFuse, and with the 1.6.5 
source, I can reduce memory consumption by putting a guard around when 
Strings are created for logging eg:

log("Copying "+fromFile+" to "+toFile, verbosity)


StringBuffer sb = new StringBuffer("Copying ").append(fromFile).append(" 
to ");
... (code elided)
//not the same behaviour, but need to try  and see : don't log unless 
user wants debug output
if (verbosity >= Project.MSG_DEBUG) {
  log(sb.append(toFile).toString(), verbosity);

This helps as the strings aren't created at all unless the verbosity is 
set to DEBUG, however, in Ant 1.7, even with this change, there is an 
OutOfMemory error.  Basically some of the 1.7 tasks are consuming much 
more memory than the 1.6.5 codebase.

In general though, the logging mechanism is always going to create a lot 
of temporary cruft as it stands, and this is perhaps one area where 
there could be some refactoring?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message