From: Matthew Bloch Date: 2002-06-21T09:04:14+09:00 Subject: Re: Improving Ruby's garbage collector for interactive apps On Thursday 20 June 2002 18:54, you wrote: > Hi, > > In message "Improving Ruby's garbage collector for interactive apps" > > on 02/06/19, Matthew Bloch writes: > |So from my survey of gc.c, Ruby's collector is the simplest possible mark > | & sweep algorithm which necessarily halts the whole system to do its > | work, and is conservative in that it doesn't necessarily find out about > | all garbage (because it must guess at what's a pointer and what's not). > | Is this correct? > > Yes and yes. Generational mark and sweep algorithm was done before, > but it was not good enough, probably due to write barrior cost. Which algorithm in particular, and how was the barrier implemented? Did you use OS page protection or catch it at application level? I'm currently grafting on on Boehm's GC library which has the properties I need (i.e. being incremental and generational) plus I believe it uses page protection hardware to implement a write barrier-- have you tried this approach already? I'm not sure I understand the issues entirely but I've basically been taking a large knife to gc.c and just replaced them with stubs to call Boehm's malloc, free etc. However this was on the train so my laptop battery ran out before I could figure out why some parts of the code called free() rather than the _free call provided in gc.c and caused a segfault trying to free memory that the C lib malloc() wasn't aware of (I think); I'll get back to it in a couple of days. I'm still very much feeling my way around but I hope I can get some relative performance figures for Boehm next week; like I said, unless you've already tried this...? -- Matthew Bloch Bytemark Computer Consulting http://www.bytemark.co.uk/ tel. +44 (0) 8707 455026