--- Daniel Barlow <dan@...> wrote:
> Right, and I don't have a macos box to test on either. Things you
> might want to check include that load-1-foreign and suchlike still
> work without mysterious heap trashing at next gc, etc.
These changes seem to work nicely with 1) a toy load-1-foreign program
and 2) loading a fairly heavy Fortran and X11 graphics library.
It is possible to allocate ~450MB in an array, load libraries,
check array for trashing, gc the array, call libraries, etc, without
encountering any problems (yet). So this is good enough for my purposes,
but I don't know if it is proof enough for production [but see 1].
> The GC uses machine registers as roots, but doesn't know which
> registers are 'live' at any given point.
I had figured it might be something like this, but I thought this was
only a concern with the conservative gc and the stack. But GC always
cleans up array from the REPL, so it certainly some local phenomenon like this.
At any rate, thanks for pointing out the location of the memory limitation.
This lets me solve my problem of a limited array size.
 vmmap of an SBCL process on Darwin shows that user level object files are
loaded into low memory, and the system libraries seem to be loaded
above #x9000000, so if my very very naive understanding of the memory map
is correct, then the changes should be safe because sbcl's memory use now ends
at #x4ffff000, well below #x9000000. But this is all an educated guess on
[output of vmmap ]
__PAGEZERO 0 [ 4K] ---/--- SM=NUL
28000 [ 4K] r--/rw- SM=SHM
__TEXT 2d000 [ 4K] r-x/rwx SM=COW
__LINKEDIT 2f000 [ 4K] r--/rwx SM=COW
404000 [ 4K] r-x/rwx SM=COW
__TEXT d5f000 [1128K] r-x/rwx SM=COW
__LINKEDIT eb5000 [ 228K] r--/rwx SM=COW
__TEXT 5000000 [ 76K] r-x/rwx SM=COW
__LINKEDIT 5015000 [ 184K] r--/rwx SM=COW
__TEXT 519d000 [1128K] r-x/rwx SM=COW
__LINKEDIT 52f3000 [ 228K] r--/rwx SM=COW
GUARD 40d5b000 [510596K] ---/rwx SM=ZER
Submap 90000000-9fffffff r--/r-- machine-wide
__TEXT 90000000 [1164K] r-x/r-x SM=COW
__LINKEDIT 90123000 [ 316K] r--/r-- SM=COW
90190000 [ 696K] r-x/r-x SM=COW
9023e000 [ 28K] r--/r-- SM=COW
90245000 [ 48K] r--/r-- SM=COW
90251000 [ 4K] r--/r-- SM=COW
90252000 [ 20K] r--/r-- SM=COW
90257000 [ 92K] r--/r-- SM=COW
90280000 [2536K] r-x/r-x SM=COW
904fa000 [ 32K] r--/r-- SM=COW
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs