some not-so-random questions

Tim Rowledge rowledge at interval.com
Tue Nov 3 17:53:20 UTC 1998


On Tue 03 Nov, Andreas Raab wrote:
> Ian,
> 
> > On Unix there is a -memory option that takes a memory size
> > (in bytes) as argument (with optional 'k' or 'm' suffix to avoid typing lots
> > of zeroes).  There is also an environment variable "SQUEAK_MEMORY" that you
> > can set, the existence of which implies the -memory option (I leave this
> > permanently set to "10m", and I've never run out of memory in Squeak ;-).
> 
> How the heck do you manage this?!?! I'm usually run Squeak with at least
> 32MB memory - that's my way not to run out of memory too early. Well,
> perhaps you've never imported a large JPEG image in 32bit Morphic?!
Acorn Squeak runs perfectly happily with -memory:5m  unless you want to
generate new VM when 8m is more useful. Obviously the Windows bloat virus has
found a way to infect your VM Andreas!

Expanding the memory allocation for Squeak should not be too difficult in most
cases. For Unix, sbrk() ought to work. For Acorn, resizing the dynamic area is
trivial.  I _think_ Mac's finally got some way to expand memory a while ago.
Windows? Hmm, how about actually allocating a huge virtual space but pretending
to the VM that you only have as much as the -memory param asked for. Then to
expand, you just change that 'fake' boundary. The only trick that springs to
mind is remembering to reset the size of the free chunk at the top of memory.

Shrinking object space wouldn't be much harder from the VM point of view,
though I'm not sure whether the released memory would get back to the OS pool
very efectively.

The real problem with both expansion and shrinking is the policy decision of
when to do it. VW has quite a complicated policy implemented in the image, with
hooks to change it almost any way you want. IIRC almost no customer ever
changed anything, they just complained that the default wasn't good enough for
them!

tim

PS I did a multi-space object memory with cross-space garbage collection and
compaction, plus grow/shrink stuff about ten years ago for the Active Book
version of BrouHaHa. It worked ok in 1Mb ram/2Mb rom, but it was not anywhere
near as efficient as I would like to see.

-- 
Strange OpCodes: SHUTDOWN: (See EFB)
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list