*tenured-bytes-limit*

$Revision: 5.0.2.4 $

Variable

Package: EXCL

The value of this variable should a positive integer or nil. We will discuss the value nil below. If the value is a positive integer, it specifies the number of bytes that must be tenured before a global gc warning or an automatic global gc (depending on the value of excl:*global-gc-behavior*) occurs. The default value depends on the specific architecture but is on the order of 3 to 5 megabytes (to find out the default value, evaluate this variable in a fresh Lisp image). We strongly advise against values less than 1000000 (i.e. approximately one megabyte).

An internal counter keeps track of the number of bytes tenured. If the value of excl:*global-gc-behavior* is not nil and the value of excl:*tenured-bytes-limit* is also not nil, this counter is updated and then checked after each scavenge. If its value exceeds the value of excl:*tenured-bytes-limit*, action depending on the value of excl:*global-gc-behavior* is taken (a warning or a global gc). The counter is reset to 0 after a global gc (however triggered). If the value of eexcl:*global-gc-behavior* is nil, the value of excl:*tenured-bytes-limit* has no user visible effect.

Note that binding this variable will likely not have the desired effect because in the presence of multiprocessing (always enabled when the Emacs-Lisp interface is used), a garbage collection can be triggered by another process, in which case the bound value will be ignored.

If the value of excl:*tenured-bytes-limit* is nil, the counter which keeps track of the number of bytes tenured since the last global gc is not updated after a scavenge. Thus, you have more control over global gc automation since you can switch off information gathering as well as control the action. Setting the value of excl:*tenured-bytes-limit* to essentially suspends the automatic global gc behavior. For example, suppose you have a large application named foo, which uses the foo package. Then you might load it with the following code. Note that we bind the value of excl:*tenured-bytes-limit* to nil, suspending the collection of information about bytes tenured and explicitly handle gc's ourselves. Automatic gc's are re-enabled when the code has finished.

(defpackage :foo)
(let ((old-spread (sys:gsgc-parameter :generation-spread))
      (excl:*record-source-file-info* nil)
      (excl:*tenured-bytes-limit* nil))
  (setf (sys:gsgc-parameter :generation-spread) 0)
  (require :foo)
  (princ "; Finished loading FOO. Global GC...")
  (terpri) (force-output)
  (gc :tenure) (gc :tenure) (gc t)
  (setf (sys:gsgc-parameter :generation-spread) old-spread))

See gc.htm for more information on garbage collection and gsgc parameters.

The general documentation description is in introduction.htm. The index is in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.