Subject: Re: Data structure size can o' worms
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 14 Jun 2003 06:45:58 -0500
Newsgroups: comp.lang.lisp
Message-ID: <EICcnf6L_4Vrl3ajXTWc-w@speakeasy.net>
Joe Marshall  <jrm@ccs.neu.edu> wrote:
+---------------
| Suppose that the system has done a full GC.  Now you SETQ *foo* to NIL
| and perform another full GC.  It seems to me that the storage
| reclaimed is *exactly* the `size' of *foo*.
+---------------

Careful!! Don't forget the builtin "history" variables in the REPL.
You probably want to do something like this:

	> (gc :full t)
	> (room)		; size while *foo* still holds a reference
	> (setq *foo* nil)	; zap *foo* and * and /
	> (setq *foo* nil)	; zap ** and //
	> (setq *foo* nil)	; zap *** and ///
	> (gc :full t)
	> (room)		; size after *foo* is gone

[I know you know all of this, but CL newbies (such as myself!)
sometimes overlook it when trying to do GC measurements...]


-Rob

-----
Rob Warnock, PP-ASEL-IA		<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607