[Gc] Re: Per-type displacement

Ludovic Courtès ludo at gnu.org
Fri Sep 19 07:28:27 PDT 2008


Hi,

Henning Makholm <henning at octoshape.com>
writes:

> Ludovic Courtès writes:
>
>> Registering a displacement globally for each value of N_EXTRA may lead
>> to excess memory retention, especially since most other Guile objects
>> ("cells") are 2 or 4 word long.
>
> How so? Registered displacements that are larger than the size of objects
> in the heap page pointed to do not count.

Hmm, I guess I had overlooked that part of the doc:

     Small blocks are allocated in chunks of size `HBLKSIZE'.  Each
  chunk is dedicated to only one object size and kind.

Then, understandably, displacements larger than a cell are not going to
affect chunks that contain only cells, so my concern is not valid.

> However if one wants to use type information while tracing pointers TO
> the object, this means that the marker has to access not only the page
> header but also the page data in order to find out whether something is
> a pointer. That might harm cache/paging performance, unless almost
> everything that looks like a pointer turns out to BE a pointer to
> something that must be traced later, in which case the whole exercise
> is pointless anyway.

Right.

> What I suspect is questionable is your assumption that you want to avoid
> GC_all_interior_pointers. Are you sure that it would be a problem just
> to recognize all pointers?

Well, I wasn't aware of the fact that chunks are allocated to only one
object size (I wasn't concerned with the possibility of misidentifying
tagged immediate numbers as pointers, but rather in cases like the
struct one and tagged pointers).

With that in mind, I'm no longer so sure.  Performance-wise, is there a
run time performance penalty in using `GC_all_interior_pointers'?

Thanks for your help,
Ludovic.



More information about the Gc mailing list