ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject report of ant holding on to thread refs in DemuxOutputStream
Date Mon, 25 Apr 2005 09:54:00 GMT

Forwarding bugrep from a friend. The implication is that  non-forked 
Java code can cause trouble
as the Demux logic hangs on to thread refs. I guess we could move to 
weakrefs and purge sporadically (how sporadically ?).

 > We finally got to the bottom of the problem by switching to IBM's JVM
 > and Heap Analyzer tool.
 > It turns out that when a java task is running within Ant's JVM (i.e. not
 > forked), System.out is redirected to an Ant class called
 > This keeps a HashMap which uses
 > the Thread.currentThread()  as the key. Thus, a strong reference is kept
 > to each Thread object that has ever written to System.out  (e.g. the
 > java logging console handler). There are certain bursty client
 > access patterns that cause Jetty of be continually varying the size of
 > the its thread pool, by killing old threads and the later creating new
 > threads. Put these things together and you have a problem! The Weak
 > References also come into it, somewhere....

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

View raw message