Re: Compile Time Garbage Collection impossible?

"Peter \"Firefly\" Lund" <firefly@diku.dk>
25 Sep 2006 01:14:58 -0400

          From comp.compilers

Related articles
Compile Time Garbage Collection impossible? the.real.doctor.zoidberg@gmail.com (2006-09-22)
Re: Compile Time Garbage Collection impossible? pjb@informatimago.com (Pascal Bourguignon) (2006-09-25)
Re: Compile Time Garbage Collection impossible? dido@imperium.ph (Rafael 'Dido' Sevilla) (2006-09-25)
Re: Compile Time Garbage Collection impossible? kym@ukato.freeshell.org (russell kym horsell) (2006-09-25)
Re: Compile Time Garbage Collection impossible? paul.biggar@gmail.com (Paul Biggar) (2006-09-25)
Re: Compile Time Garbage Collection impossible? firefly@diku.dk (Peter \Firefly\Lund) (2006-09-25)
Re: Compile Time Garbage Collection impossible? gneuner2@comcast.net (George Neuner) (2006-09-25)
Re: Compile Time Garbage Collection impossible? liekweg@ipd.info.uni-karlsruhe.de (Florian Liekweg) (2006-09-25)
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)
[8 later articles]
| List of all articles for this month |

From: "Peter \"Firefly\" Lund" <firefly@diku.dk>
Newsgroups: comp.compilers
Date: 25 Sep 2006 01:14:58 -0400
Organization: Department of Computer Science, University of Copenhagen
References: 06-09-119
Keywords: GC
Posted-Date: 25 Sep 2006 01:14:58 EDT

On Sat, 22 Sep 2006 the.real.doctor.zoidberg@gmail.com wrote:


> Why isn't Compile-Time-Garbage-Collection feasible? Consider a Java
> compiler which produces assembly code for a specific target instead of
> Java's bytecode cenario. The objective is to use Java without the need
> for a GC or VM.


Google for region-based memory management.


> I'm asking why it isn't possible because otherwise there would be at
> least one compiler to use that technique, instead of having to run a
> GC in the VM.


http://www.google.com/search?q=region+memory+management+java


> [Local objects are usually stack allocated and freed at end of scope.
> You need GC when you do dynamic allocation, and chain stuff into lists
> and trees of data structures. -John]


Not always. Sometimes you can statically determine when to free them.


Java creates very tangled memory (+ tends to allocate much more than
necessary). ML creates cleaner memory so it works better with pure memory
management.


Some programs don't need a runtime garbage collector if they use
region-based memory management but most do (but the garbage collector has
much less work to do since much of the memory gets released
automatically).


-Peter


Post a followup to this message

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