[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to ask "how big is it?"



I've used the document examiner to search for this, without any luck.  Does
anyone have a utility that grovels over an object in memory and reports on how
much storage it occupies?  I found SYS:%STRUCTURE-TOTAL-SIZE, but this doesn't
chase pointers (e.g. to include all objects accessible in a linked
datastructure).

It would be nice if this thing knew enough about the system that I could tell
it not to chase certain kinds of pointers.  That is, I realize I don't really
want everything that's accessible from some object (e.g. if it gets to a
symbol, I probably don't want to include that symbol's package and everything
accessible from that package).

I've got a circuit simulator that builds a large datastructure, and right now,
I only have rough estimates of how large this datastructure really is.  The
program generates a lot of garbage, so the information that CL:TIME gives me
isn't indicative.  I suppose if I consed it all in one area and then did
something with the garbage collector, I could find out.  Alternatively, I
could write a special purpose thing which knows about my datatypes and uses
SYS:%STRUCTURE-TOTAL-SIZE over and over again.  But is there a simpler way?
I'd like to ask for this kind of information fairly often, and not have to
modify this utility every time I add a new datatype to my program.

- Mark Shirley