Re: Compile Time Garbage Collection impossible?

Robert A Duff <bobduff@shell01.TheWorld.com>
30 Sep 2006 17:37:21 -0400

          From comp.compilers

Related articles
[8 earlier articles]
Re: Compile Time Garbage Collection impossible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-09-25)
Re: Compile Time Garbage Collection impossible? torbenm@app-0.diku.dk (2006-09-25)
Re: Compile Time Garbage Collection impossible? liekweg@ipd.info.uni-karlsruhe.de (Florian Liekweg) (2006-09-26)
Re: Compile Time Garbage Collection impossible? alewando@fala2005.com (A.L.) (2006-09-28)
Re: Compile Time Garbage Collection impossible? torbenm@app-3.diku.dk (2006-09-28)
Re: Compile Time Garbage Collection impossible? sleepingsquirrel@yahoo.com (Greg Buchholz) (2006-09-28)
Re: Compile Time Garbage Collection impossible? bobduff@shell01.TheWorld.com (Robert A Duff) (2006-09-30)
Re: Compile Time Garbage Collection impossible? danwang74@gmail.com (Daniel C. Wang) (2006-09-30)
Re: Compile Time Garbage Collection impossible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-09-30)
Re: Compile Time Garbage Collection impossible? int2k@gmx.net (Wolfram Fenske) (2006-09-30)
Re: Compile Time Garbage Collection impossible? scgupta@yahoo.com (Satish Chandra Gupta) (2006-10-03)
Re: Compile Time Garbage Collection impossible? oliver@first.in-berlin.de (Oliver Bandel) (2006-10-08)
| List of all articles for this month |
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: 30 Sep 2006 17:37:21 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 06-09-119 06-09-146
Keywords: storage, Java
Posted-Date: 30 Sep 2006 17:37:21 EDT

"A.L." <alewando@fala2005.com> writes:


> On 22 Sep 2006 22:29:03 -0400, the.real.doctor.zoidberg@gmail.com
> wrote:
>
> >Why isn't Compile-Time-Garbage-Collection feasible?
> >
> > ...so what would be the
> >problem in "freeing" objects after their scope, or even better, after
> >the last reference in their scope?
>
> Determining what objects could be deallocated during compilation is
> equivalent to "halting problem" that is undecidable. i.e. there is
> no algorithm possible that could do this for all possible programs.


Quite true. But run-time garbage collectors have the same problem -- it
is in general undecidable whether a given object can be deallocated,
even when the GC runs at run time. The run-time decision can be made
much more accurately, though.


But the OP's question was much more straightforward:


> [In Java] what would be the problem in "freeing" objects after their
> scope, or even better, after the last reference in their scope?


Because one can return references to such objects and/or plant such
references in more-global variables.


- Bob



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.