MLton RAM usage

Anoq of the Sun anoq@HardcoreProcessing.com
Wed, 19 Sep 2001 12:26:31 +0200



Stephen Weeks wrote:
> No, MLton does not look at free, it just looks at total RAM.  We wanted to pick
> a default that would let us run apps (including the compiler) as successfully
> and quickly as possible.  And since our runtime is such a space hog, we decided
> to go for the larger amount.  The max-heap and fixed-heap stuff is for more
> sophisticated users who need to limit space.  I agree it's not ideal.  Does
> anyone know if there's an easy way to get the amount of free RAM?
> 
> The main annoyance for us to add this is complexity in compiler switches to
> specify the approach you would want (unless we can all agree on one) and
> communicating it to the runtime.  Anyways, if this becomes a serious problem for
> you, let us know, and we can add the switch.

Well, looking at /proc/meminfo again, I see the following:

        total:    used:    free:  shared: buffers:  cached:
Mem:  528846848 201199616 327647232 23728128 137613312 30453760
Swap:        0        0        0
MemTotal:    516452 kB
MemFree:     319968 kB
MemShared:    23172 kB
Buffers:     134388 kB
Cached:       29740 kB
SwapTotal:        0 kB
SwapFree:         0 kB

I would say that looking at MemFree and using, say 95% of that would be
a good idea. Maybe try to also look at SwapFree if the app really
needs more memory - which will of course degrade performance.


Cheers
-- 
http://www.HardcoreProcessing.com