From: Daniel Barlow <dan_b@us...> - 2003-04-20 15:47:38
Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs1:/tmp/cvs-serv23674/src/code
Refactor some of the lisplevel GC stuff in baby steps, with
end goal of finding out why its when-to-gc decisions are
so bad when multiple threads are allocating
Let's start by losing *soft-heap-limit*, because I have never
ever seen it actually work anyway
RCS file: /cvsroot/sbcl/sbcl/src/code/gc.lisp,v
retrieving revision 1.43
retrieving revision 22.214.171.124
diff -u -d -r1.43 -r126.96.36.199
--- gc.lisp 18 Apr 2003 03:13:27 -0000 1.43
+++ gc.lisp 20 Apr 2003 15:47:35 -0000 188.8.131.52
@@ -180,24 +180,6 @@
(declaim (type index *gc-run-time*))
-;;; a limit to help catch programs which allocate too much memory,
-;;; since a hard heap overflow is so hard to recover from
-;;; FIXME: Like *GC-TRIGGER*, this variable (1) should probably be
-;;; denominated in a larger unit than bytes and (2) should probably be
-;;; renamed so that it's clear from the name what unit it's
-;;; denominated in.
-(declaim (type (or unsigned-byte null) *soft-heap-limit*))
- ;; As long as *GC-TRIGGER* is DECLAIMed as INDEX, we know that
- ;; MOST-POSITIVE-FIXNUM is a hard limit on how much memory can be
- ;; allocated. (Not necessarily *the* hard limit, which is fairly
- ;; likely something like a Unix per-process limit that we don't know
- ;; about, but a hard limit anyway.) And this gives us a reasonable
- ;; conservative default for the soft limit...
- (- most-positive-fixnum
;;;; The following specials are used to control when garbage
;;;; collection occurs.
@@ -326,21 +308,7 @@
(let* ((*already-maybe-gcing* t)
- (pre-gc-dynamic-usage (dynamic-usage))
- ;; Currently we only check *SOFT-HEAP-LIMIT* at GC time,
- ;; not for every allocation. That makes it cheap to do,
- ;; even if it is a little ugly.
- (soft-heap-limit-exceeded? (and *soft-heap-limit*
- (> pre-gc-dynamic-usage
- (*soft-heap-limit* (if soft-heap-limit-exceeded?
- (+ pre-gc-dynamic-usage
- (when soft-heap-limit-exceeded?
- (cerror "Continue with GC."
- "soft heap limit exceeded (temporary new limit=~W)"
+ (pre-gc-dynamic-usage (dynamic-usage)))
(when (and *gc-trigger* (> pre-gc-dynamic-usage *gc-trigger*))
(setf *need-to-collect-garbage* t))
(when (or force-p