Skip to main content

room

room Function

Syntax:

room &optional x → implementation-dependent

Arguments and Values:

x—one of t, nil, or :default.

Description:

room prints, to standard output, information about the state of internal storage and its management. This might include descriptions of the amount of memory in use and the degree of memory compaction, possibly broken down by internal data type if that is appropriate. The nature and format of the printed information is implementation-dependent. The intent is to provide information that a programmer might use to tune a program for a particular implementation.

(room nil) prints out a minimal amount of information. (room t) prints out a maximal amount of information. (room) or (room :default) prints out an intermediate amount of information that is likely to be useful.

Side Effects:

Output to standard output.

Affected By:

*standard-output*.

Expanded Reference: room

Displaying memory usage information

room prints information about the state of internal storage and its management. The format is implementation-dependent.

(room)
; Dynamic space usage: ...
; Read-only space usage: ...
; ...
=> ; no useful return value

Verbosity levels

room accepts an optional argument controlling the amount of detail: :default, t (verbose), or nil (brief).

;; Brief summary
(room nil)
;; prints brief memory statistics (implementation-dependent)
;; => ; no useful return value

;; Detailed breakdown
(room t)
;; prints detailed per-type memory statistics
;; => ; no useful return value

;; Default level of detail
(room :default)
;; => ; no useful return value

Using room for memory profiling

room is useful during development to check how much memory is being consumed.

;; Check memory before and after allocating a large structure
(room nil)
(defparameter *big-list* (make-list 1000000))
(room nil)
; Compare the output to see memory impact
=> ; no useful return value