[Pharo-project] how to find the memory size of an object graph

Tudor Girba tudor at tudorgirba.com
Mon Jul 23 03:45:46 EDT 2012


I have some problems with memory consumption in a Moose model.
However, I do not quite know where the memory is spent.

To solve this, I would need to know the amount of space occupied by
the objects (and all the referenced objects subgraphs).

I found Object>>sizeInMemory, but this only shows the size of the
current object. What I would need is a graph traversal that does not
break on cyclic graphs, and that accumulates the size of the objects.

I thought of using Fuel for this. I tried to follow the instructions from here:

and work with the debug facilities:
(ConfigurationOfFuel project version: '1.8') load: #(FuelDebug).

For small examples, it seems to work fine:
FLAnalyzer newDefault setDebug; analysisFor: #((1) (2) (3) (4))

However, for larger examples, the process takes forever.

Is there another way of approaching this problem?



"Every thing has its own flow"

More information about the Pharo-dev mailing list