[Oberon] DISPOSE

muller at inf.ethz.ch muller at inf.ethz.ch
Sun Sep 1 23:17:06 CEST 2002


Gérard_Meunier <gmeunier at club-internet.fr> wrote:
> Garbage collection is a blessing for most programmers, and makes system and
> applications more robust. But sometimes it's a bane. I've written, in
> Bluebottle, an interpreter for a language whose one of most important
> features is that it produces no garbage. It allocates a lot of stuff in the
> heap, but it knows exactly the lifetime of each chunk of memory. Therefore
> it would be very interesting and efficient to dispose memory by hand. Is
> there any way to do that?

Not currently, but it would not be too difficult to add a Dispose procedure
in AosHeap if someone would like to try.  Basically the block to be disposed
has to be added to the correct free list (global variable "freeList").

I'm not sure if this should be done, since disposing manually is error-prone
and dangling pointers are horrible to debug.

Do you currently have an efficiency problem with the garbage collector?
By setting the "TraceHeap" config string you can see trace info about
heap procedures in the kernel log, including the times of various phases 
of the collection.  See the end of AosHeap.Mod for flag values for 
"TraceHeap".  For accurate timings, set the config string "MHz" to
the speed of your processor (e.g. "MHz=400").

The current collector still includes some debug code by default, viz. 
clearing all deallocated storage to the constant "0DEADDEADH".  This 
can be quite an overhead.  To disable, set DebugValue = 0 in AosHeap,
recompile, relink the kernel and reinstall it on the boot device
(see Aos.Tool).

-- Pieter

--
Pieter Muller, Computer Systems Institute, ETH Zurich / MCT Lab, Zurich
Native Oberon OS: http://www.oberon.ethz.ch/native/



More information about the Oberon mailing list