This is useful when a significant number of transient objects actually survive all the garbage collections on generation 1. These would normally then be promoted and, by default, never get collected. In such a situation,
will free a large amount of space in generation 2.
can be thought of as doing set-promotion-count on generation 1 with an infinite
, for the duration of body.
is suitable only for use in particular operations that are known to create such relatively long-lived, but transient, objects. In typical uses these are objects that live for a few seconds to several hours. An example usage is LispWorks compile-file, to ensure the transient compile-time data gets collected.
has global scope and hence may not be useful in an application such as a multi-threaded server. During the execution of
, generation 1 grows to accomodate all the allocated data, which may have some negative effects on the behaviour of the system, in particular on its interactive response.
Note: symbols and process stacks are allocated in generation 2, hence
cannot prevent these getting into generation 2. allocation-in-gen-num can also cause allocation in higher generations.
Note: in 64-bit LispWorks,
is implemented using set-blocking-gen-num.