GC play

Darrell news at dorb.com
Sat Jun 19 13:20:34 EDT 1999


When searching for leaks I can live with less preformance.
It doesn't seem that tracing works for some cases.
The "All Done" comes out with any mention of l.append(l1)
So I don't know how to record the traceback.
Would I be wasting my time to think about a new or modified sys.trace ?

def t1(f,e,a):
 print 'T1:',e
 return t1

def t2(f,e,a):
 print 'T2:',e
 return t2

sys.setprofile(t1)
sys.settrace(t2)

def myFunc(x):
 print x

l=[]
l1=[]
l.append(l1)
print 'All Done:'
myFunc('PassedValue')

******** Output *********
All Done:
T2: call
T1: call
T2: line
T2: line
PassedValue
T2: return
T1: return
T1: return

--
--Darrell
Martin von Loewis <loewis at informatik.hu-berlin.de> wrote in message
news:p6qlndgrwtk.fsf at pandora.inst-inf-1.hu-berlin.de...
> Greg Ewing <greg.ewing at compaq.com> writes:
>
> > I don't think there's anything you can find out about the source
> > of any other kind of object.
>
> Although I wonder: Would it be possible to record a traceback for each
> object allocated, to support purify-like leak analysis? It would
> surely be very inefficient, and you'd also need to release all the
> locals in the traceback - but would it work?
>
> Regards,
> Martin






More information about the Python-list mailing list