Mailing List Archive

Memory leak under Idle?
Howdy,

I was testing my stackless Python which now does also
most builtins without involving the C stack, and I thought
to use Idle as a testing horse.
By chance, I discovered a very high reference count
of None, after Idle was run.

Then I tested it with standard python 1.5.2, and discovered
the same problem. (Which makes me happy about my version,
but a little concerned about TK related stuff).

Here my DOS session and the refcounts of None:


D:\python\PNSpeed>python
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import sys
>>> sys.getrefcount(None)
164
>>> import os
>>> os.chdir("d:/python/tools/idle")
>>> execfile("idle.py")
>>> sys.getrefcount(None)
2232
>>> execfile("idle.py")
>>> sys.getrefcount(None)
2326
>>>

What's going on here?
Just cyclic references piling up?

ciao - chris

--
Christian Tismer :^) <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
10553 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
we're tired of banana software - shipped green, ripens at home
Memory leak under Idle? [ In reply to ]
[Christian Tismer]
> ...
> What's going on here?
> Just cyclic references piling up?

Cyclic references are piling up (at least proportional to the number of
windows you've opened), but haven't looked into it deeper than that (an
EditorWindow holds refs to the extensions it installs, and extensions often
keep a reference to the EditorWindow that installed them). Played briefly
with trying to clear an EditorWindow's __dict__ at window close time, but Tk
started griping about bogus callbacks. If you grab the latest development
IDLE off of CVS, though, it's bound to be even worse <wink>.

if-pystone-works-ship-it-ly y'rs - tim