Cyclops 0.9.4
Tim Peters
tim_one at email.msn.com
Sun Jul 25 23:57:37 EDT 1999
[Greg Ewing]
> ...
> I can look for certain kinds of object, though. If
> I open ten BlargWindows and then close them, I know
> there shouldn't be any BlargWindow instances left.
> If there are, I can take a closer look at them to
> find out what what's happening.
Perfectly reasonable. Under Cyclops <wink>, register those 10 by hand, or
put a .register(self) call in BlargWindows.__init__.
> ...
> I'm not asking to be told about every possible way
> of reaching every live object, obviously!
That you weren't asking for that was obvious, but what you were asking for
wasn't. Now it's clearer:
> What I mean is, once I've found (by whatever means) a live object that
> I know should be dead, I should be able to say "show me a path from the
> root set to this object". I don't need all paths, only one of them --
> somewhere along that path there will be a link that shouldn't be there,
> and it should be fairly easy to spot.
Sounds like a good idea to me too.
>> All objects ever allocated, or all objects whose refcounts haven't yet
>> fallen to 0?
> The latter.
>> Since "even ints are boxed" in Python, that's a major memory hit.
> Which is why I'm happy for it to be a debugging option,
> maybe requiring a different interpreter. Although if M&S
> is ever added, we're going to have to live with this
> overhead all the time -- or find a smarter way to handle
> it.
Guido suggested focussing on dicts; perhaps "containers" is sufficient
(being an object that contains a pointer -- doesn't seem any loss to exempt
ints, strings, floats, etc).
>> Let's say you have everything you want, and even more: ...
> Tim, this is expandio ad absurdum! I never asked for all that
> information.
Sure. My point was that even with perfect & complete information, the hard
problems remain.
> All I said whas that it would be handy to have a way to discover the
> existence of dead objects taking up room in my heap. I never expected
> the idea to be this controversial...
Na, *every* idea is *endlessly* controversial until someone actually
implements it; then it becomes an endless source of complaints <wink>.
You're absolutely right that Python has no way to tell you this now, with or
without Cyclops, and that it would be of some help. "Purify"-like tools can
do that for C, and I was blue-skying because such tools have never been
*enough* of a help. More info or better info is needed, but at this time we
can't get either.
dreamily y'rs - tim
More information about the Python-list
mailing list