PackageDescription: TAG-MemoryUsage

TAG - Memory Usage

Last published: January 17, 2012 by 'tgriggs'

Defines 1 Classes
Extends 3 Classes

A MemoryTrace object that can be used to get a feel for how much memory is being used by object graphs. Workspace example:

| trace |
trace := MemoryTrace new.
trace visitAllInstancesOf: LocaleLocalizationComponent.
trace inspect

There are also 4 different menu options added to the IDE, they are self explanatory hopefully:

Inspector...Object...Memory Usage
Browser...Package...Memory Usage <-- "all general instances of all classes defined by the package"
Browser...Class...Query...Memory Usage
Browser...Class...Query...Memory Usage (with subclasses)

Caveat: The byte counts may not be exactly precise. The current computation is simple/naive, and doesn't worry about things like fixed table entries, the extra pointer when an object lives in large space, etc. The innacuracy should be in the noise. I welcome corrections/refinements to the algorithm.