From: Nikodemus Siivola Date: Sun, 29 Apr 2012 17:06:45 +0000 (+0300) Subject: gencgc: scale generation.bytes_consed_between_gc to number of gens X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=661bcd7d3e0bdc1966f3878fa71d322ffd5927a4;p=sbcl.git gencgc: scale generation.bytes_consed_between_gc to number of gens This means we have by default 5% of total heap usable in the nursery between GCs, and another 5% of the total heap split between all the generations -- and roughly matches the nursery/old generation sizes relations from before the dynamic-space-size based scaling. Fixes lp#991293, regression since 6848a92fd4af23d0695eeaaed9efcbdfd9e1d9e5. --- diff --git a/NEWS b/NEWS index b9acb31..897c552 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,8 @@ changes relative to sbcl-1.0.56: * bug fix: miscompilation of LDB on the PowerPC platform. (thanks to Bruce O'Neel) * bug fix: better input error reporting for COMPILE-FILE. (lp#493380) + * bug fix: default size of non-nursery generations has been shrunk on GENCGC, + allowing faster release of memory back to the OS. (lp#991293) * documentation: ** improved docstrings: REPLACE (lp#965592) diff --git a/src/code/gc.lisp b/src/code/gc.lisp index b477d98..a9893b0 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -435,8 +435,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 -5% of the dynamic space size. Can be assigned to using SETF. Available on -GENCGC platforms only. +5% of the dynamic space size divided by the number of non-nursery generations. +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 6decdde..a73bdca 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -4038,7 +4038,8 @@ 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 = bytes_consed_between_gcs; + generations[i].bytes_consed_between_gc + = bytes_consed_between_gcs/(os_vm_size_t)HIGHEST_NORMAL_GENERATION; 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 d21d14a..cb9e3e7 100644 --- a/tests/gc.impure.lisp +++ b/tests/gc.impure.lisp @@ -56,7 +56,8 @@ (with-test (:name :bug-529014 :skipped-on '(not :gencgc)) (loop for i from 0 to sb-vm:+pseudo-static-generation+ do (assert (= (sb-ext:generation-bytes-consed-between-gcs i) - (sb-ext:bytes-consed-between-gcs))) + (truncate (sb-ext:bytes-consed-between-gcs) + sb-vm:+highest-normal-generation+))) ;; 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).