On Sat, 05 Apr 2008 07:55:14 +0100, Jon Harrop <jon@[EMAIL PROTECTED]
>
wrote:
>
>As I understand it, MLKit is entirely region-based memory management and
the
>Stalin Scheme compiler uses similar techniques and this is fundamentally
>different from both reference counting and mark and sweep GC.
>
>What are the implications of this technique and how well do the compilers
>perform in practice? Does it suffer from stalls or keeping values alive
too
>long?
Region management is "mark-release" ... essentially a stack of heaps.
The unit of reclamation is the heap - objects are (usually) allocated
as needed but all the objects within a heap are deallocated all at
once. An object's lifetime determines to which heap it is assigned
and good management depends crucially on the compiler being able to
determine close bounds on the object's lifetime.
Dynamic objects with indeterminate lifetimes must be placed in a
catch-all region that must be GC'd in a long running system. Only the
catch-all region requires GC as a backup, all other dynamic regions
can be (de)allocated using simple stack discipline.
It's interesting (to me at least) Tofte did so much work on regions
with a functional language because one of the major strong points of
FPLs is easy sharing of data objects, but shared objects are the
Achilles' heel of regions. It's difficult and impossible to
accurately bound the lifetime of a shared object and so shared objects
are almost inevitably allocated to regions that long outlive the
usefulness of the object. Regions are almost ideally suited to "use
once" objects as in [1] but few languages (and no popular ones)
implement that particular data model.
George
[1] Henry Baker, "'Use-Once' Variables and Linear Objects —
Storage Management, Reflection and Multi-Threading", ACM Sigplan
Notices 30 (Jan 1995), p45-52.
--
for email reply remove "/" from address


|