The JVM also does not call finalize when it is exiting.

thanks,

- Dale

On Thu, Feb 08, 2001 at 12:43:48PM +0100, Nico Seessle wrote:
> ----- Original Message -----
> From: "Jeremy Roedde" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 07, 2001 5:08 PM
> Subject: Q: How does ant tasks get garbage collected.
> 
> 
> > I am calling ant from a java program by doing the following;
> >
> > org.apache.tools.ant.Main.main(new String[]{"-buildfile","build.xml"});
> >
> >  It seems that tasks are not garbage collected (a finalize method in a
> task
> > never gets called). Does anyone know a good way around this without
> > modifying ant code?
> >
> 
> I can't tell you if maybe Ant is heaving a problem with not freeing some
> references properly, but in genereal you should never rely on something you
> put in a finalize-method to ever be executed. If the VM thinks there is no
> need to free the objects currently (and there are other things to do) it may
> not do so.
> 
> Nico
> 

Reply via email to