Dynamic system memory use

Tim Rowledge tim at sumeru.stanford.edu
Thu Jan 31 18:44:54 UTC 2002


Squeak can increase the memory it uses if the OS supports a suitable
method of extending the original allocation - or potentially making a
new larger allocation and copying the entire object memory across and
swizzling all the pointers. See the macros
    #define sqGrowMemoryBy(oldLimit, delta) oldLimit
    #define sqShrinkMemoryBy(oldLimit, delta) oldLimit
    #define sqMemoryExtraBytesLeft(includingSwap) 0
in sq.h and their uses.

Other Smalltalks with more complex object memory models can do it other
ways; VW has (last time I looked) a half-dozen or so memory spaces and
can add memory in the old-space region.

One of the classic problems with trying to extend or reduce memory usage
is thrashing; you do all the work of getting more or releasing some and
- wham, you need to reverse and do the opposite. I did a version once
that tried a hysterisis approach of never releasing more than one
previously added segment jst in case and that worked quite well in the
seriously memory constrained environment in which it lived (1Mb ram
total on the machine).

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- A titanic intellect...  In a world full of icebergs.




More information about the Squeak-dev mailing list