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

Re: JWZ on s/Java/Perl/

From:
Dan Sugalski
Date:
February 9, 2001 13:06
Subject:
Re: JWZ on s/Java/Perl/
Message ID:
5.0.2.1.0.20010209160038.01b47258@24.8.96.48
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.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About