From 6848a92fd4af23d0695eeaaed9efcbdfd9e1d9e5 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sat, 19 Nov 2011 16:35:18 +0200 Subject: [PATCH] default gen.bytes_consed_between_gc to same 5% of dynamic space size ...the previous default was 2,000,000 bytes, not 20Mb as the documentation claimed. Oops. --- NEWS | 4 ++-- src/code/gc.lisp | 3 ++- src/runtime/gencgc.c | 2 +- tests/gc.impure.lisp | 13 +++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 8040ec6..f86d780 100644 --- a/NEWS +++ b/NEWS @@ -24,8 +24,8 @@ changes relative to sbcl-1.0.53: STANDARD-INSTANCE-ACCESS, and FUNCALLABLE-STANDARD-INSTANCE-ACCESS. ** Users can now defined new places usable with SB-EXT:COMPARE-AND-SWAP using an API anologous to defining new SETFable places. - * enhancement: on GENCGC systems nursery size now defaults to 5% of - dynamic-space size. + * enhancement: on GENCGC systems nursery and generation sizes now default to + 5% of dynamic-space size. * enhancement: on CHENEYGC targets, SB-KERNEL:MAKE-LISP-OBJ now does the same validation of pointer objects as GENCGC does, instead of a comparatively weak bounds-check against the heap spaces. diff --git a/src/code/gc.lisp b/src/code/gc.lisp index 44b3ac5..2d2dc84 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -419,7 +419,8 @@ Note: currently changes to this value are lost when saving core." "Number of bytes that can be allocated to GENERATION before that generation is considered for garbage collection. This value is meaningless for generation 0 (the nursery): see BYTES-CONSED-BETWEEN-GCS instead. Default is -20Mb. Can be assigned to using SETF. Available on GENCGC platforms only. +5% of the dynamic space size. Can be assigned to using SETF. Available on +GENCGC platforms only. Experimental: interface subject to change." t) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 87f20a4..12fecd6 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -4136,7 +4136,7 @@ gc_init(void) generations[i].num_gc = 0; generations[i].cum_sum_bytes_allocated = 0; /* the tune-able parameters */ - generations[i].bytes_consed_between_gc = 2000000; + generations[i].bytes_consed_between_gc = bytes_consed_between_gcs; generations[i].number_of_gcs_before_promotion = 1; generations[i].minimum_age_before_gc = 0.75; } diff --git a/tests/gc.impure.lisp b/tests/gc.impure.lisp index a5e9bfb..faf5693 100644 --- a/tests/gc.impure.lisp +++ b/tests/gc.impure.lisp @@ -54,10 +54,11 @@ ;;; SB-EXT:GENERATION-* accessors returned bogus values for generation > 0 (with-test (:name :bug-529014 :skipped-on '(not :gencgc)) - ;; FIXME: These parameters are a) tunable in the source and b) - ;; duplicated multiple times there and now here. It would be good to - ;; OAOO-ify them (probably to src/compiler/generic/params.lisp). (loop for i from 0 to sb-vm:+pseudo-static-generation+ - do (assert (= (sb-ext:generation-bytes-consed-between-gcs i) 2000000)) - (assert (= (sb-ext:generation-minimum-age-before-gc i) 0.75)) - (assert (= (sb-ext:generation-number-of-gcs-before-promotion i) 1)))) + do (assert (= (sb-ext:generation-bytes-consed-between-gcs i) + (sb-ext:bytes-consed-between-gcs))) + ;; FIXME: These parameters are a) tunable in the source and b) + ;; duplicated multiple times there and now here. It would be good to + ;; OAOO-ify them (probably to src/compiler/generic/params.lisp). + (assert (= (sb-ext:generation-minimum-age-before-gc i) 0.75)) + (assert (= (sb-ext:generation-number-of-gcs-before-promotion i) 1)))) -- 1.7.10.4