pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Are there any docs for ReferenceFinder?

TM
Tim Mackinnon
Sun, Aug 1, 2021 1:56 PM

Hi everyone - I was curious why my image is 3gb, and recently someone mentioned ReferenceFinder which I’ve not used before - however the class comment for it is very terse and it doesn’t really explain what a “reference path is” and how to interpret the results you get back from it?

eg. I did the following - as I have lots of instances of Document object I have been using in an an inspector - however I had cleared out the owner objects list of these things, and so they should be gone. However I see the following:

ReferenceFinder findAllPathsTo: X allInstances first.

Result - a collection of objects (as in the photo). So am I to understand that the “path” is actually the collection? Each item in the collection is the next segment of the path to the ultimate object (which might be useful for the class description to say - and I will correct if that’s the case).

Hi everyone - I was curious why my image is 3gb, and recently someone mentioned ReferenceFinder which I’ve not used before - however the class comment for it is very terse and it doesn’t really explain what a “reference path is” and how to interpret the results you get back from it? eg. I did the following - as I have lots of instances of Document object I have been using in an an inspector - however I had cleared out the owner objects list of these things, and so they should be gone. However I see the following: ReferenceFinder findAllPathsTo: X allInstances first. Result - a collection of objects (as in the photo). So am I to understand that the “path” is actually the collection? Each item in the collection is the next segment of the path to the ultimate object (which might be useful for the class description to say - and I will correct if that’s the case).
TM
Tim Mackinnon
Sun, Aug 1, 2021 2:29 PM

As a follow-on question to this - it seems that the playground keeps hidden references to things (although the image I am trying this in, looks to be some earlier P9 image - so potentially the GTK version of the playground is better).

However I am wondering why if I close my playground and open a fresh one, and restore its snippets - why the following doesn’t seem to clean up garbage:

3 timesRepeat: [ Smalltalk garbageCollect ].
MwpDocumentDetails allInstances.

Neither does the following:

Smalltalk garbageCollect.
Smalltalk garbageCollect.
Smalltalk garbageCollect.
MwpDocumentDetails allInstances.

But the following:

Smalltalk garbageCollect. <- cmd-g this 3 times
MwpDocumentDetails allInstances.

Does?

Something seems rather suspicious to me in all this… although I need to replicate this in a proper P9 image - but I was curious what the difference is - and whether its the playground that is the leading cause of this?

Tim

On 1 Aug 2021, at 15:56, Tim Mackinnon tim@testit.works wrote:

Hi everyone - I was curious why my image is 3gb, and recently someone mentioned ReferenceFinder which I’ve not used before - however the class comment for it is very terse and it doesn’t really explain what a “reference path is” and how to interpret the results you get back from it?

eg. I did the following - as I have lots of instances of Document object I have been using in an an inspector - however I had cleared out the owner objects list of these things, and so they should be gone. However I see the following:

ReferenceFinder findAllPathsTo: X allInstances first.

Result - a collection of objects (as in the photo). So am I to understand that the “path” is actually the collection? Each item in the collection is the next segment of the path to the ultimate object (which might be useful for the class description to say - and I will correct if that’s the case).

<PastedGraphic-1.png>

As a follow-on question to this - it seems that the playground keeps hidden references to things (although the image I am trying this in, looks to be some earlier P9 image - so potentially the GTK version of the playground is better). However I am wondering why if I close my playground and open a fresh one, and restore its snippets - why the following doesn’t seem to clean up garbage: 3 timesRepeat: [ Smalltalk garbageCollect ]. MwpDocumentDetails allInstances. Neither does the following: Smalltalk garbageCollect. Smalltalk garbageCollect. Smalltalk garbageCollect. MwpDocumentDetails allInstances. But the following: Smalltalk garbageCollect. <- cmd-g this 3 times MwpDocumentDetails allInstances. Does? Something seems rather suspicious to me in all this… although I need to replicate this in a proper P9 image - but I was curious what the difference is - and whether its the playground that is the leading cause of this? Tim > On 1 Aug 2021, at 15:56, Tim Mackinnon <tim@testit.works> wrote: > > Hi everyone - I was curious why my image is 3gb, and recently someone mentioned ReferenceFinder which I’ve not used before - however the class comment for it is very terse and it doesn’t really explain what a “reference path is” and how to interpret the results you get back from it? > > eg. I did the following - as I have lots of instances of Document object I have been using in an an inspector - however I had cleared out the owner objects list of these things, and so they should be gone. However I see the following: > > ReferenceFinder findAllPathsTo: X allInstances first. > > Result - a collection of objects (as in the photo). So am I to understand that the “path” is actually the collection? Each item in the collection is the next segment of the path to the ultimate object (which might be useful for the class description to say - and I will correct if that’s the case). > > <PastedGraphic-1.png>