PointerFinder comes up empty

Bob Arning arning at charm.net
Wed Sep 26 01:03:47 UTC 2001


Hi Ross,

On Tue, 25 Sep 2001 10:08:32 -0700 Ross Boylan <RossBoylan at stanfordalumni.org> wrote:
>I'm trying to track down some junk in my image, but when I do
>
>PointerFinder on: ((ActivityPlan allInstances select: [:x | x activity
>name = 'sizing']) at: 1)
>
>I get, after a very long, CPU intensive delay, a blank pointer finder
>window.
>
>Originally the select: produced a long list, some of which apparently
>was garbage collected while pointer finder ran.  That produced an
>empty result to, but that makes sense.  In contrast, the one remaining
>item above does not get garbage collected, but I can't get its roots.
>
>Any ideas what's causing this, or how to fix it?

The short answer is the old joke,

Patient: Doc, it hurts when I do this.
Doctor: Don't do that.

The long answer is that #allInstances will find objects which are no longer referenced. When you run this, it is quite possible that the 'at: 1' returns such an object. While the PointerFinder is actually running, that object becomes referenced by an instance variable in the PointerFinder (goal), this prevents it from being gc'd, but this refrence is ignored by the PointerFinder. Thus, the answer is an empty set.

The moral of the story is to do a garbageCollect (or two) before really trusting what #allInstances tells you.

Cheers,
Bob






More information about the Squeak-dev mailing list