[squeak-dev] how to determine available RAM?

Chris Muller asqueaker at gmail.com
Thu May 6 22:36:40 UTC 2021


I have an old method from 2014 which could calculate the maximum
*addressable* RAM for 32-bit images.  First it checked for the -memory
or -mmap arguments (are these still supported?) and used them if
specified, otherwise, it default to these hard-coded numbers:

    isRunningSpur?  -> 3.8GB
else    Win32?  ->  500MB
           else -> 1GB

But now with 64-bit, the addressable exceeds the available RAM of most
machines.  What is that max addressable BTW, 64GB?

Also, what about taking into account what the OS believes it has
*remaining*?  Can it be done within the image or would I have to call
out to "free" via OSProcess or something..?

Thanks for any tips.

 - Chris


More information about the Squeak-dev mailing list