[Aldor-l] Garbage collector
Jacques Carette
carette at mcmaster.ca
Thu Dec 20 10:01:08 EST 2007
Pippijn van Steenhoven wrote:
> By the way, you said that some functions allocate lots of easily
> reclaimable memory.
This is "conventional wisdom" for all (mostly) functional languages,
from LISP onwards, not a detailed observation of Aldor per se.
> There is quite a lot of string duplication (as can
> be seen in the call log) and FoamNew calls.
That, on the other hand, is hard data. The string duplication calls is
something real to examine - it just might be that this is what is needed
to get non-mutable strings into Aldor! The FoamNew calls need to be
classified further (some are real, some are just for transient objects I
would guess).
> I wonder if it would be a
> good idea to make the GC optional (core code can free the memory it
> uses) and minimise its use within the compiler.
>
If the GC takes that much time while running the compiler, my guess is
you'd need a machine with many many Gigabytes of memory to run the
compiler without the GC enabled. At least that is what I have seen in
similar languages.
As far as having code free its own memory, I believe that this discussion
http://lambda-the-ultimate.org/node/2552
is relevant, and it basically concludes that if you have enough memory
then GC vs explicit memory management have similar performance
profiles. Only in tight memory spaces does explicit memory management
make a (spectacular!!) difference.
Jacques
More information about the Aldor-l
mailing list