Good point. I will personally keep this in mind as I work in Ant and be on the lookout for any such situations (reference to an OutputStream or Writer nulled w/o being closed?). Maybe we can periodically test removing the gc call, especially if a committer thinks he has fixed a missing close() issue.
Thanks, Matt --- "Alexey N. Solofnenko" <[EMAIL PROTECTED]> wrote: > I have had such problems with still open files and > every time I thought > it was a JDK bug, but later by adding try/finally > with close() I fixed > it. gc() is usually needed when somebody forgets to > close a stream (and > there was just such bug in ANT about not closing a > stream and I think it > was in 1.6.0 too). While there are bugs in JDK, I do > not think we should > blame it first. > > - Alexey. > > Dominique Devienne wrote: > > >>From: Matt Benson [mailto:[EMAIL PROTECTED] > >> > >> > >>>Nope, I'm running 1.6.0. But it's always scary to > me > >>>when one needs > >>>System.gc() in ones code... As we all know, this > >>> > >>> > >>Dominique: please believe that I hated to add > this to > >>the code. Unfortunately, IT WORKS. If you search > the > >>lists you will find that I said when I added it > that I > >>didn't want to believe it was true... Another > place > >>that would have achieved a similar effect would be > on > >>LazyFileOutputStream.close(), since most files > created > >>by Ant are created this way... it's just something > to > >>do with Windows JVMs not properly releasing file > >>handles or something until after gc, best I can > tell... > >> > >> > > > >Don't get me wrong Matt, no question what you're > doing is > >the right thing, since it fixes real problems. But > I always > >hate it when we litter our code with turn arounds > for bugs. > > > >No other solution here, but I wish SUN would fix > their VMs > >instead ;-) All 1.{1|2|3|4|5} of them ;-)))) --DD > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: > [EMAIL PROTECTED] > >For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]