Re: Garbage collection

tmk@netvision.net.il (Michael Tiomkin)
5 Aug 2004 14:11:36 -0400

          From comp.compilers

Related articles
garbage collection lex@cc.gatech.edu (Lex Spoon) (2003-07-13)
Garbage collection wmccabe@hotmail.com (2004-07-28)
Re: Garbage collection nmm1@cus.cam.ac.uk (2004-08-04)
Re: Garbage collection sk@z.pl (Sebastian) (2004-08-04)
Re: Garbage collection tmk@netvision.net.il (2004-08-05)
Re: Garbage collection basile-news@starynkevitch.net (Basile Starynkevitch \[news\]) (2004-08-05)
Re: Garbage collection nick.roberts@acm.org (Nick Roberts) (2004-08-09)
Re: Garbage collection vbdis@aol.com (2004-08-10)
Re: Garbage collection gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-08-11)
Re: Garbage collection nick.roberts@acm.org (Nick Roberts) (2004-08-13)
Re: Garbage collection t.zielonka@zodiac.mimuw.edu.pl (Tomasz Zielonka) (2004-08-13)
[14 later articles]
| List of all articles for this month |

From: tmk@netvision.net.il (Michael Tiomkin)
Newsgroups: comp.compilers
Date: 5 Aug 2004 14:11:36 -0400
Organization: http://groups.google.com
References: 04-07-085
Keywords: GC, comment

wmccabe@hotmail.com (William McCabe) wrote
> I am in the process of writing my own programming language and I would
> like to use garbage collection as a means for automatic memory
> management. I have decided that I want to implement a two-stage
> generational copying collector.
>
> I know how a copying and generational collector works but Im not sure
> how they work when put together. In my mind, generational is similar
> to coping in being that they both seperate the heap into two
> semi-spaces, but use totaly different methods to collect garbage. Can
> someone shed some light on this subject for me.


    You can try to check what is done in Java, they use 4 generations
with different GC methods for different groups for one of their last
GCs:


http://java.sun.com/docs/hotspot/gc1.4.2/index.html
http://www-106.ibm.com/developerworks/java/library/j-jtp11253


    Notice that there is a problem with references from the "old"
objects to the "new" objects, these references need special treatment.


    BTW, I'm not sure that GC is a part of a compiler, it's usually a
part of runtime support of a language.
[It's runtime, but it's often useful to tweak the compiler to generate
code that makes GC easier. -John]


Post a followup to this message

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