I think sage's memory management is making progress: examples of getting 
obvious leaking are getting more convoluted. I ran into the following one. 
With the code

import gc
def t(N,start=0):
    P=PolynomialRing(QQ,name='x')
    x=P.gen(0)
    L=[NumberField(x^2+1,name="a%d"%start)]
    for i in range(start,N-1):
        R=PolynomialRing(L[i],name="X")
        Li=NumberField(R.gen(0)^2+L[i].gen(0),name="a%d"%(i+1))
        L.append(Li)
    return L
def Nobjects(t):
    return len([a for a in gc.get_objects() if isinstance(a,t)])

I get:

sage: T=type(t(2)[1])
sage: Nobjects(T)
1
sage: L=t(5)
sage: Nobjects(T)
4
sage: del L
sage: Nobjects(T)
4
sage: gc.collect()
1633
sage: Nobjects(T)
3
sage: gc.collect()
0
sage: Nobjects(T)
3

i.e., it seems that as soon as a field is used as a base field for further 
extensions, it's nailed in memory.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to