email@example.com.EDU (Olin Shivers) writes:
> I can't understand it either. Something is way wrong here. Perhaps
> your default heap is set too high. Try running scsh with smaller
> heaps, and see how low you can go.
One of the major heinosities of Scheme 48 (and the runtimes of several
other functional languages I've worked with) is that it preallocates a
fixed heap. Kelsey's ostensible reason for doing this was that it
would be a Bad Thing if the amount of memory an s48 process took up got
larger than the amount of VM the machine provided.
While this reasoning is okay as far as it goes, it has a problem: why
is the heap preallocated at its maximum size? Damned if I know. I
submitted a patch around the beginning of last year which grew the
semispaces as needed, but there hasn't been a public release in the
intervening time. An improvement on my patch from this perspective
would be to put a cap on heap size.
This memory allocation problem becomes more acute in scsh's particular
case. Kelsey's desktop box had about 128M of memory, last time I
heard. This is fine for running a small number of s48 processes, but
if you really want scsh to run as a workable shell on a "saner"
configuration - maybe you should count your bare-bones vanilla machine
as a Linux box with 8M or 16M of RAM - then you want to dynamically
change the heap size, and make sure the initial heap is statically
linked, and generally spend lots of time jumping through hoops in the
service of a small memory footprint.
It looks like using Bill Sommerfeld's suggestion about using mmap,
coupled with a dynamically-sized heap, would be a good starting point
with this end in mind.
Let us pray:
What a Great System.
Please Do Not Crash. firstname.lastname@example.org