'gc.free'
Robert Van Dam
rvandam00 at gmail.com
Mon May 1 18:04:48 CEST 2006
I was playing with various 'gc' properties and discovered something
that I found rather surprising and counter-intuitive (from what the
docs state).
Under the documentation for the Property module is a page documenting
the Garbage collection properties. For the property 'gc.free' there
is the following explanation:
"Gives the percentage of free heap memory after garbage collection.
For example, a value of 75 means that threshold is set to
approximately: active*100/(100-75)=active*4."
What I discovered was that the '100/(100-x)' part is subsequently
rounded down to the nearest integer. I might have supposed this from
the use of integers in the example but I thought it was only a
simplified example.
What this appears to mean is that rather than having a range of
'1..100' as the documentation suggests, 'gc.free' actually only has a
range of
[50 67 75 80 84 86 88#100] (and yes, 100 does work, and is not the
same as 99, go figure). Which means that the multiplier on the active
heap size that creates (approximately) the threshold has a range of
[2#12 14 16 20 25 33 50 100].
This is definitely not the kind of behavior I expected after reviewing
that documentation several times (I did expect the non-linearity, but
not the integral values).
My problem is that I want finer grained control on the threshold size
without having to do most of the memory management myself (which it
looks like I'll have to do for the time being).
Is this a bug or an unexpected feature? If its a feature, maybe the
documentation needs some clarification?
Rob Van Dam
More information about the mozart-users
mailing list