From: William Harold Newman <william.newman@ai...> - 2000-08-28 14:11:30
On Mon, Aug 28, 2000 at 05:38:21AM +0100, Daniel Barlow wrote:
> Peter Van Eynde <pvaneynd@...> writes:
> > Note that the .core file with rwxp is mapped. AFAIK this means COW...
> Fair enough, but _is_ it written to? I believed that as the system
> was purified before it was dumped, basically everything should be in
> non-collected memory. On that basis, I can't see how it would be
> getting mutated.
(This is an off-the-top-of-my-head answer, without any deep knowledge
of the issue and without checking the source or experimenting with it.)
As I understand it, PURIFYing just means that the stuff won't be
garbage collected, not that it won't be mutated.
In many cases, I think it must be mutated. For example, the hash
tables used to implement packages, the global variables used to
implement the state of the byte interpreter, and the various Common
Lisp globals that we know and love (e.g. *PRINT-RADIX*) should all
be slurped into uncollectable memory by PURIFY.
That said, a lot of it will never be written, because it's just code,
or constant list structure representing templates, or other constants.
If I understand correctly, this means that while copy-on-write will
force some copying, a whole lot of the image can still be shared.
Probably even more could be shared if we added some heuristics to
PURIFY in order to try to collect the likely-to-be-mutated stuff in
one area, so that mutating e.g. *PRINT-RADIX* didn't cause an entire
page of constant data adjacent to it to be copied.
Note also that there seems to be a small efficiency issue in PURIFYing
everything the way that we do, in that things which grow dynamically,
like the aforementioned hash tables used to implement packages, will
leave behind some uncollected memory if they grow much larger after
PURIFY is done.
William Harold Newman <william.newman@...>
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C