Metagnostic
home

Space Breakdown for Dolphin Smalltalk

Goodies

JNIPort

Z-Kit

ListTree

Space Breakdown

F.M.B.

Ghoul

Miscellanea

Experiments

Changes

Prerequisites

Licence

This package contains two small tools for investigating what objects are taking up space in the image. They are both intended to give a “broad-brush” impression of what is going on, rather than trying to track down details.


The first, Space Breakdown installs itself in the 'Extra Tools' system folder and menu. Its concept and operation are almost breathtakingly simple. It scans all the objects in the image (unfortunately, only the ones that derive from Object) and shows a list of how many instances of each class there are, and an estimate of how much physical space (in bytes) they take up between them. It also lists how many finalisable instances each class has, which can help, for instance, in tracking down resource leaks.

Breakdown of Objects in the image by their classes

The the 'View' menu contains options for setting the thresholds that determine which classes will be listed. By default it shows all classes that are not metaclasses and which have at least one instance.

The tool can also save its current data to a file (it's stored in CSV format, in case you should wish to import it into a spreadsheet — unlikely, I know…). The main reason for doing this is that you can then, at a later time, use the 'Compare with file' operation (on the 'File' menu) to launch a new list which displays the differences between the two snapshots. (The data has to be written to file, rather than being stored in the image somewhere, or else it would skew the second snapshot). Here's a picture of the difference between two snapshots a few minutes apart.

Differences between two snapshots


The second tool, Reference Breakdown is launched from the 'Class' menu of the Space Breakdown. It is launched on one or more selected classes, and scans the image looking to see what objects hold onto references to instances of those classes. In particular, it looks to see which instance variables the references are held in. For instance this screen shot:

Breakdown references to LargeIntegers by classes and instvars

shows a breakdown of references to LargeInteger. You can see that most of them are used by CompiledMethods to hold their sourceDescriptors. However, the fourth row also shows that 328 references are held in CompiledMethods' indexed slots — presumably these are large integer literals in methods.


Packages

Package sizes and versions
Name Size Version
CU Space Breakdown 82048 3.01

Prerequisite packages' sizes and versions
Name Size Version
CU Hashed Pair 10870 1.00
CU Package-relative File Locator 11829 3.01
CU Sortblocks 16398 3.01
CU Storage Size 1809 1.00
CU String Extensions 6885 1.00
CU Tools Base 34422 0.0009 (unpublished)

Copyright © Chris Uppal, 2003-2005