Skip to main content

storage-condition

storage-condition Condition Type

Class Precedence List:

storage-condition, serious-condition, condition, t

Description:

The type storage-condition consists of serious conditions that relate to problems with memory management that are potentially due to implementation-dependent limits rather than semantic errors in conforming programs, and that typically warrant entry to the debugger if not handled.

Depending on the details of the implementation, these might include such problems as stack overflow, memory region overflow, and storage exhausted.

Notes:

While some Common Lisp operations might signal storage-condition because they are defined to create objects, it is unspecified whether operations that are not defined to create objects create them anyway and so might also signal storage-condition. Likewise, the evaluator itself might create objects and so might signal storage-condition. (The natural assumption might be that such object creation is naturally inefficient, but even that is implementation-dependent.) In general, the entire question of how storage allocation is done is implementation-dependent, and so any operation might signal storage-condition at any time. Because such a condition is indicative of a limitation of the implementation or of the image rather than an error in a program, objects of type storage-condition are not of type error.

Expanded Reference: storage-condition

The storage-condition Type

storage-condition is a condition type representing situations where storage (memory) resources are exhausted or unavailable. It is a subtype of serious-condition but not of error, reflecting that it may arise asynchronously and is often difficult to handle programmatically.

(subtypep 'storage-condition 'serious-condition)

=> T
=> T

Not a Subtype of error

(subtypep 'storage-condition 'error)
=> NIL
=> T

Handling Storage Conditions

Because storage-condition is not an error, it is not caught by handler-case clauses that match error. You must explicitly match storage-condition or serious-condition.

;; This handler-case clause would catch a storage-condition:
;; (handler-case <form>
;; (storage-condition () :out-of-memory))
;;
;; But this would NOT catch it:
;; (handler-case <form>
;; (error () :this-misses-storage-condition))