Re: Memory management



> From: Felix Bellaby <felix@pooh.u-net.com>
> 
> However, no garbage collection algorithm is
> ever as efficient as throwing away garbage when you know that it
> is garbage.

Well, that's just not true.  If you have complicated data structures
and garbage is created very quickly it can be slower to do the
bookkeeping needed to determine when something becomes garbage
and trace through the garbage freeing it a bit at a time, than
simply to ignore it until the crisis, then trace the small
amount of non-garbage and recycle the rest in one big chunk.

On the other hand, if garbage is created very slowly, the program
may print the answer and terminate before you ever need to 
call the GC at all.

But that is getting pedantic, a widget library does not fit
either of those conditions.  The widgets generaly run on
simple tree-structured data, garbage accumlates slowly over
a long time, and garbage creation us usually associated
with specific actions (such as deleting a window) rather
than by dropping the last of many links to it in the course
of a complicated calculation.

-- 
     --Keith

This mail message sent by GNU emacs and Linux.
Food, Shelter, Source code.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]