Dan Sugalski <[EMAIL PROTECTED]> writes:

> 'Kay, here's a question.
>
> How much control should we allow user programs to have over the
> garbage collector and memory allocation system?
>
> Right now, there's a default memory pool size and a default headers
> per alloc count, both set with #defines, and a default number of
> failed allocations before we collect, hard-coded in
> resources.c. (Currently 64K, 256, and 1, respectively) It'd be easy
> enough to make these changeable on a per-interpreter basis, but I'm
> not sure if it's worth it or not.
>
> Arguably they ought to be under the control of the GC system itself
> with some sort of clever feedback system (which is pricey, but called
> rarely, and seem to improve performance sufficiently to make it
> worthwhile) but I'm not sure when, or if, we'll have that sort of
> system in place.
>
> OTOH, exposing the controls for twidding does mean that we probably
> won't ever be able to unexpose them, which limits our potential
> flexibility in the future.
>
> Opinions, folks?

There's some discussion about tweaking garbage collectors in Kent
Beck's Guide to Better SmallTalk, where he gives a rough overview of a
typical SmallTalk's GC controls and discusses when you might want to
tweak them (essentially, you might find that the kind of data mix your
application has is 'pathological' for the current settings, so you
fiddle with the knobs a bit to get something that plays well with your
application. 

He also points out that doing that is more of an art than a science
and you're unlikely to do it often enough that it will *become* a
science, but makes a good case for the controls being accessible. 

My gut feeling is that we should make them available, but fenced about
with caveats about the interface being subject to radical change if we
find a better GC mechanism, or even if you find yourself running in a
different environment. And if you're at the point where you're
tweaking the GC controls you're probably going to 're tweak' them when
you upgrade parrot too, and if the interface has changed, well, you
suck it up and get on with the job.

-- 
Piers

   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?

Reply via email to