develooper Front page | perl.perl6.language | Postings from February 2001

Re: JWZ on s/Java/Perl/

Dan Sugalski
February 9, 2001 13:06
Re: JWZ on s/Java/Perl/
Message ID:
At 05:29 PM 2/9/2001 -0200, Branden wrote:
>Ken Fox wrote:
> >  2. Work proportional to live data, not total data. This is hard to
> >     believe for a C programmer, but good garbage collectors don't have
> >     to "free" every allocation -- they just have to preserve the live,
> >     or reachable, data. Some researchers have estimated that 90% or
> >     more of all allocated data dies (becomes unreachable) before the
> >     next collection. A ref count system has to work on every object,
> >     but smarter collectors only work on 10% of the objects.
>Does this 90/10 ratio mean that the memory usage is actually 10 times it
>needs to be? (if it were even _possible_ to pack all the data without
>fragmentation problems)

No. It means that 90% of the memory allocated between runs of the GC gets 
freed. The memory isn't wasted, by any means.

Most memory is allocated for ephemeral things--objects that come and go, 
temporary buffers, scratch space, and suchlike things. It's normal.


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                      teddy bears get drunk Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About