[Gc] Re: heapsize == blocks_in_use_bytes * 40

Hans Boehm Hans.Boehm at hp.com
Thu Oct 12 21:50:23 PDT 2006

On Thu, 12 Oct 2006, Adam Megacz wrote:

> Well, there are quite a few rapid array allocation/deallocations in
> the ~3mb range.  These are certainly large arrays, but could they
> cause fragmentation-leakage on the order of >160mb?
Possibly.  It depends on how many of them are simultaneously live,
and whether the allocation requests are running into black-listed
pages and are thus having trouble finding a suitable spot in
the address space.  It's useful to run this with GC_PRINT_STATS on.
If you get a bunch of expansions in a row tih essentially no
intervening allocation that's usually a blacklisting problem.
This may not be obvious from the dump, because the collector will
eventually just allocate the blacklisted pages as pointerfree.
That way they end up never getting touched but appearing to be in
the heap.  (This avoids constantly scanning them during allocations.)
> > (-DUSE_MUNMAP may be a workaround.)
> Is this supported on Win32?  I had to kludge it a bit to get it to
> build, but it doesn't appear to be doing anything.
It may not show up in the statistics printed by the collector.
Those really measure occupied address space, not allocated pages.
It should work, though.  You might try watching the amount of
memory used in some other tool, like the task manager.  (It isn't
quite implemented the way I would like, so it may not quite do
what you really want.  But people usually seem to have better luck
with it than I would have expected.)
> >> The GC reports the heapsize (which I interpret to mean the quantity of
> >> memory allocated from the OS) to be 160MB, yet the "bytes=" line
> >> (which I interpret to mean the amount of memory allocated by the
> >> application) as around 4.5mb.
> Could you confirm that my understanding of the "bytes=" line is
> correct?  Does that line from the GC log really indicate the number of
> GC-heap bytes that have been allocated to the application?  It seems a
> bit low in this situation, but I guess that could be because we're
> used to assuming the ~160mb is actual usage.
It should be correct.

> Thanks again for your help,
>   - a
> --
> PGP/GPG: 5C9F F366 C9CF 2145 E770  B1B8 EFB1 462D A146 C380
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/

More information about the Gc mailing list