aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-11-28 17:58:23 +0100
committerBjörn-Egil Dahlberg <[email protected]>2012-12-14 15:12:58 +0100
commit971d054018d94dd89c2323e237f9c6c3afa91e3b (patch)
treeb08c3898628f4ddfe8dbbb5ca6741b0b610e81fc /erts/emulator
parent860f0fdb4b14619fdc57621ea820381287eb8711 (diff)
downloadotp-971d054018d94dd89c2323e237f9c6c3afa91e3b.tar.gz
otp-971d054018d94dd89c2323e237f9c6c3afa91e3b.tar.bz2
otp-971d054018d94dd89c2323e237f9c6c3afa91e3b.zip
erts: Make gc sizes fit into MB Carrier blocks
* Account for block header size in gc-sizes * Also slow down growth to 20% instead of 25% when size threshold is reached
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_gc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 6075a527c3..cf06cedf7f 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -168,15 +168,21 @@ erts_init_gc(void)
* we really don't want that growth when the heaps are that big.
*/
- heap_sizes[0] = 34;
- heap_sizes[1] = 55;
- for (i = 2; i < 23; i++) {
- heap_sizes[i] = heap_sizes[i-1] + heap_sizes[i-2];
+ /* Growth stage 1 - Fibonacci + 1*/
+ /* 12,38 will hit size 233, the old default */
+
+ heap_sizes[0] = 12;
+ heap_sizes[1] = 38;
+
+ for(i = 2; i < 23; i++) {
+ /* one extra word for block header */
+ heap_sizes[i] = heap_sizes[i-1] + heap_sizes[i-2] + 1;
}
+ /* Growth stage 2 - 20% growth */
/* At 1.3 mega words heap, we start to slow down. */
for (i = 23; i < ALENGTH(heap_sizes); i++) {
- heap_sizes[i] = 5*(heap_sizes[i-1]/4);
+ heap_sizes[i] = heap_sizes[i-1] + heap_sizes[i-1]/5;
if (heap_sizes[i] < 0) {
/* Size turned negative. Discard this last size. */
i--;