[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: gencgc: scale generation.bytes_consed_between_gc to number of gens
From:       "Nikodemus Siivola" <demoss () users ! sourceforge ! net>
Date:       2012-04-29 17:33:15
Message-ID: E1SOXzr-0003SX-5X () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  661bcd7d3e0bdc1966f3878fa71d322ffd5927a4 (commit)
      from  f1f283e6bee12b7d70bcec52aa226d0532a490fb (commit)

- Log -----------------------------------------------------------------
commit 661bcd7d3e0bdc1966f3878fa71d322ffd5927a4
Author: Nikodemus Siivola <nikodemus@sb-studio.net>
Date:   Sun Apr 29 20:06:45 2012 +0300

    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.
---
 NEWS                 |    2 ++
 src/code/gc.lisp     |    4 ++--
 src/runtime/gencgc.c |    3 ++-
 tests/gc.impure.lisp |    3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

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).

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic