Hi there, I'm trying to understand the following memleak without success. Consider three functions:
def f(X): try: return ZZ(X) except TypeError: X = ZZ(map(ZZ,X),2) return X def g(X): try: return ZZ(X) except TypeError: pass def h(X): X = ZZ(map(ZZ,X),2) return X As you can see below, f leaks: m = get_memory_usage() for i in xrange(10^3): _ = f([1,0,1]) print get_memory_usage() - m 4.72265625 while g and h are clean: m = get_memory_usage() for i in xrange(10^3): _ = g([1,0,1]) print get_memory_usage() - m 0.0 m = get_memory_usage() for i in xrange(10^3): _ = h([1,0,1]) 0.0 So it seems each component of the function is clean but their combination leaks. Any ideas? Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---