Analysing the image size and its evolution
This page looks into analysing the size of the Glamorous Toolkit image. It also shows how to analyse the size of the image over time.
This analysis is based on
Object subclass: #SpaceTally
and it reports memory space consumed by instances of each class in the system.
Object subclass: #GtSpaceTallyHistory
instanceVariableNames: 'tallyVersions tallyItemVersionsByClassName'
contains a list of
Object subclass: #GtSpaceTallyVersion
instanceVariableNames: 'index label timestamp spaceTally vmStatisticsReport'
, where each version holds a
SpaceTally subclass: #GtSpaceTally
The system maintains a default history, and it adds several tallies to it during the creation of the Glamorous Toolkit image. Below is the list of versions curently recorded.
We can also explore the history by looking at the difference in memory by grouping instances by the package or repository defining the class of the instance.
Managing the history
The current object holding the history can be accessed using the snippet below.
We can add when needed new recordings to the history.
We can also label the version.
GtSpaceTallyHistory recordDefaultSystemWideDataLabeled: 'Custom Label'
In case we have multiple versions in the history we can create diffs between any two versions.
diff := GtSpaceTallyDiff new sourceVersion: GtSpaceTallyHistory default firstVersion; targetVersion: GtSpaceTallyHistory default latestVersion.
We can also creatre invidual space tallies if needed.
spaceTally := GtSpaceTally new. spaceTally systemWideSpaceTally. systemWideSpaceTally