Variable | Package: excl | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## *tenured-bytes-limit*

The value of this variable should be 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 `*global-gc-behavior*`) occurs. The default value depends on the specific architecture but is generally 20 megabytes for 32 bit Lisps and 50 megabytes for 64 bit lisps. We strongly advise against values less than 5000000 (i.e. approximately five megabytes).

An internal counter keeps track of the number of bytes tenured. If the value of `*global-gc-behavior*` is not `nil` and the value of `*tenured-bytes-limit*` is also not `nil`, this counter is updated and then checked after each scavenge. If its value exceeds the value of `*tenured-bytes-limit*`, action depending on the value of `*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 `*global-gc-behavior*` is `nil`, the value of `*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 `*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 `*tenured-bytes-limit*` to `nil` 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 also gc.htm for general information on garbage collection in Allegro CL, including information on gsgc switches and parameters.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version