[Pharo-dev] [ANN] RefsHunter

Pavel Krivanek pavel.krivanek at gmail.com
Tue Apr 19 09:44:20 EDT 2016


when we were trying to fix memory leaks in the system in last weeks, it was
very handy to create a small tool that shows a shortest path of backward
references from one object to another one. Our tool is named RefsHunter and
you can find it in the Catalog of Pharo 5.

You can use Gofer if you want to load it without tests to the minimal Pharo:

Gofer new
smalltalkhubUser: 'PavelKrivanek' project: 'RefsHunter';
package: 'RefsHunter-Core';

The RefsHunter creates a temporary snapshot of all objects in the image and
then collects information about all non-weak backward references. After
that you can ask on the shortest path from one object to another one. That
is useful for example when you still have got some leaking instance in the
image and you want to see how is it linked with the global space.


| rh |
rh := RefsHunter snapshot.
rh wayFrom: (Array>>#asArray) to: Smalltalk specialObjectsArray.

Notice that this tool is very memory demanding and it is not good idea to
make a new RefsHunter snapshot when you still have some previous snapshot
in the object memory.

-- Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20160419/35c16b58/attachment.html>

More information about the Pharo-dev mailing list