gc_ms2_tuning branch
Nick Wellnhofer
wellnhofer at aevum.de
Sun Sep 26 18:04:09 UTC 2010
I just created a new branch gc_ms2_tuning. It contains a port of the
dynamic GC threshold to the new GC code. The memory_used counter now
also accounts for attribute and other fixed size storage and ignores
constant objects. The old code could lead to a lot more memory being
used than accounted for, so rather low thresholds could still work very
well. To address this, the default dynamic GC threshold has been
increased to 75%. Note that these changes have not been applied to the
old GC. It still uses the old accounting.
It also turned out that the double linked lists in the new GC code are
quite a hit on performance and memory consumption. I replaced them with
a simple array as GC mark stack but afaics the double linked lists will
also be used for Generational GC. So maybe this approach doesn't work out.
Here are some more notes on the GC thresholds to avoid confusion. There
are two thresholds: a static and a dynamic one. The Parrot memory
management counts the amount of memory newly allocated since the
previous GC run. If this amount exceeds both the static and dynamic
threshold, another GC run is triggered.
Currently, the static threshold of the old GC (ms) is hardcoded to 1MB.
The static threshold of the new GC (ms2) is 256MB in trunk and 1MB in my
new branch.
The dynamic threshold is a percentage of the total memory used directly
after the last GC. (After a GC run we know exactly the minimum memory a
process requires.) This allows us to adjust the timing of GC runs to the
actual memory requirements of a process. It also roughly limits the
percentage of memory wasted. Currently, the dynamic threshold of the old
GC is 25% (although this is skewed, see my notes above). The new GC in
trunk has no dynamic threshold, the new GC in my new branch uses 75%.
The dynamic threshold is a space-time tradeoff. Generally, lower values
cause more GC runs, more execution time and less memory consumption. But
on memory limited machines, a lower threshold can also improve general
perfomance if it avoids swapping.
Nick
More information about the parrot-dev
mailing list