[ANN] RefsHunter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] RefsHunter

Pavel Krivanek-3
Hi,

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';
load.

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.

Example: 

| 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.

Cheers,
-- Pavel
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RefsHunter

Max Leske
YESSSS!!!! (insert *micdrop*)


> On 19 Apr 2016, at 15:44, Pavel Krivanek <[hidden email]> wrote:
>
> Hi,
>
> 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';
> load.
>
> 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.
>
> Example:
>
> | 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.
>
> Cheers,
> -- Pavel


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RefsHunter

Mariano Martinez Peck
In reply to this post by Pavel Krivanek-3
Hi Pavel,

This would have helped us to track that evil object years ago (remember the name???) hahaha. 
Anyway, do you think it's worth an integration of this to http://smalltalkhub.com/#!/~BenComan/PointerDetective ??

Best, 

On Tue, Apr 19, 2016 at 10:44 AM, Pavel Krivanek <[hidden email]> wrote:
Hi,

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';
load.

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.

Example: 

| 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.

Cheers,
-- Pavel



--
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RefsHunter

Pavel Krivanek-3


2016-04-19 15:53 GMT+02:00 Mariano Martinez Peck <[hidden email]>:
Hi Pavel,

This would have helped us to track that evil object years ago (remember the name???) hahaha. 

Dzindzik :-)
 
Anyway, do you think it's worth an integration of this to http://smalltalkhub.com/#!/~BenComan/PointerDetective ??

It should be pretty easy. it deserves an attempt.

-- Pavel
 

Best, 

On Tue, Apr 19, 2016 at 10:44 AM, Pavel Krivanek <[hidden email]> wrote:
Hi,

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';
load.

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.

Example: 

| 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.

Cheers,
-- Pavel



--

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RefsHunter

Mariano Martinez Peck


On Tue, Apr 19, 2016 at 11:08 AM, Pavel Krivanek <[hidden email]> wrote:


2016-04-19 15:53 GMT+02:00 Mariano Martinez Peck <[hidden email]>:
Hi Pavel,

This would have helped us to track that evil object years ago (remember the name???) hahaha. 

Dzindzik :-)


That one!!!!! haahahha I checked my emails and ... uff.. that was in 2012 ;)  we are getting older haha. 
 
 
Anyway, do you think it's worth an integration of this to http://smalltalkhub.com/#!/~BenComan/PointerDetective ??

It should be pretty easy. it deserves an attempt.


Cool!  Note that there are many efforts in this area. Please see https://github.com/dalehenrich/obex

Cheers,


 
-- Pavel
 

Best, 

On Tue, Apr 19, 2016 at 10:44 AM, Pavel Krivanek <[hidden email]> wrote:
Hi,

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';
load.

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.

Example: 

| 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.

Cheers,
-- Pavel



--




--
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RefsHunter

Ben Coman
In reply to this post by Pavel Krivanek-3
On Tue, Apr 19, 2016 at 10:08 PM, Pavel Krivanek
<[hidden email]> wrote:

>
>
> 2016-04-19 15:53 GMT+02:00 Mariano Martinez Peck <[hidden email]>:
>>
>> Hi Pavel,
>>
>> This would have helped us to track that evil object years ago (remember
>> the name???) hahaha.
>
>
> Dzindzik :-)
>
>>
>> Anyway, do you think it's worth an integration of this to
>> http://smalltalkhub.com/#!/~BenComan/PointerDetective ??

The last few commits of this are not stable.  Unfortunately I got
distracted in the middle of some re-factoring when I stumbled due to
debugging circular references which locked the image [1] .  I should
look at reviving this for Pharo 5, maybe on Bloc...

[1] https://pharo.fogbugz.com/default.asp?14827  - printString locks
Image on circular references

cheers -ben

>
> It should be pretty easy. it deserves an attempt.
>
> -- Pavel
>
>>
>>
>> Best,
>>
>> On Tue, Apr 19, 2016 at 10:44 AM, Pavel Krivanek
>> <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> 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';
>>> load.
>>>
>>> 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.
>>>
>>> Example:
>>>
>>> | 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.
>>>
>>> Cheers,
>>> -- Pavel
>>
>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>
>