[gclist] Boehm collector vs lazy allocation with demand
paging
David Chase
chase@world.std.com
Tue, 08 Apr 1997 09:59:24 -0500
At 09:42 PM 4/8/97 +1000, Fergus Henderson wrote:
>Several memory areas used by the Mercury runtime engine
>such as the Mercury stacks are allocated with a fixed size
>at startup, with the idea being that with demand paging,
>we can allocate much more than we will need, and the OS
>will allocate it lazily for us as we actually use it.
>
>Unfortunately this idea doesn't work with the Boehm collector,
>because the collector scans all of memory, which I think causes
>the memory to allocated (even though the collector is only reading
>it, not writing to it), and which certainly slows down garbage
>collections.
If you're not (over-)allocating through the garbage collector,
then it ought to suffice to modify its scan of the root set.
Also, are you certain it is really doing this? In the case of
stacks, I thought that the B-W collector was really quite careful
to only scan the currently active portion of the stack (because
scanning dead stack frames is a likely source of "spurious" pointers).
Or, are these stacks that you obtain via mmap from /dev/zero, or
some similar device?
David Chase