Heap Utilization

heap-utilization walks the lisp heap, collects information about the objects stored on the heap, and prints a report of the results to stream. It shows the number of objects of each type, the logical size (i.e. the size of the data part of the object) and the physical size (the logical size plus any header and padding bytes).

If gc-first is true (the default), does a full gc before scanning the heap.

If classes is true, classifies objects by class rather than just basic type.

area can be used to restrict the walk to one memory area or a list of areas. Some possible values are :dynamic, :static, :managed-static, :readonly. By default, all areas (including stacks) are examined.

sort can be one of :count, :logical-size, or :physical-size to sort output by count or size.

unit can be one of :kb:mb or :gb to show sizes in units other than bytes.

If start is non-nil, it should be an object returned by get-allocation-sentinel; only
objects at higher address are scanned (i.e. roughly, only objects allocated after it).

If threshold is non-nil, it should be a number between 0 and 1. All types whose share of the heap is less than threshold will be lumped together in an "All Others" line rather than being listed individually.