[Python-bugs-list] [ python-Bugs-485142 ] memory leak in test_binop

noreply@sourceforge.net noreply@sourceforge.net
Wed, 05 Dec 2001 15:31:15 -0800


Bugs item #485142, was opened at 2001-11-24 10:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=485142&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Tim Peters (tim_one)
Summary: memory leak in test_binop

Initial Comment:
test_binop leaks memory in longobjects
see attached file for detailed info

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-12-05 15:31

Message:
Logged In: YES 
user_id=31435

Thank you for finding this, Neal!  test_binop in an 
infinite loop no longer grows, after Guido fixed the 
__slots__ leak, so closing this one (it grew megabytes per 
second before that fix).  The connection to longs is simply 
that the Rat class stores some long objects in its 
__slots__; if it had stored floats instead, this would have 
looked leak a float leak; etc.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-12-05 14:22

Message:
Logged In: YES 
user_id=31435

Reassigned to me because I started on it, and boosted 
priority.

Turns out that when an object of a new-style class with 
__slots__ goes away, the slot vars don't get decref'ed 
(like the Rat class in test_binop).  This is a serious bug 
and Guido is opening a separate report on it.  I'll come 
back to this bug after it's fixed (it may well be the only 
problem in test_binop).

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-11-27 12:05

Message:
Logged In: YES 
user_id=31435

Assigned to Barry.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=485142&group_id=5470