[Gc] Re: Effective heap utilization
hans.boehm at hp.com
Fri Oct 12 16:32:25 PDT 2007
> From: Ludovic Courtès
> "Bruce Hoult" <bruce at hoult.org> writes:
> > The simplest idea is to do a GC_dump() and look at the
> number of mark
> > bits set in each heap block compared to the possible number
> of objects
> > in that block (the blocksize divided by the size of objects in that
> > block).
> Good idea. I used the attached Scheme script to parse the
> line produced by `GC_dump ()' (or `GC_DUMP_REGULARLY')
> showing the blocks in use.
> With a libgc-based Guile running a small program creating
> lots of garbage, I get a total-to-alive heap ratio of 1.03,
> which seems pretty good (I believe there were no
> uncollectable objects).
This seems to good to be true.
gc7 with GC_PRINT_STATS set will print totals for reachable memory.
GC_get_free_bytes() currently only includes bytes in completely empty pages.
More information about the Gc