Open 85eec1a4-3d04-4b4d-b711-d4db03337c41 opened 17 years ago
The link to the discussion in sage-devel is
http://groups.google.com/group/sage-devel/t/673812f3d9ed262a
Cheers,
Michael
For some more discussion and a potential cause check out
http://groups.google.com/group/sage-devel/t/5a1d104614ced3aa
Cheers,
Michael
Okay, the problem I found is deep in Cython generated code and maybe not the fault of Cython, but might be an underlying issue in Python. For each of the 244 pyx files we have in the tree we do not deallocate a dictionary. While this isn't a defect per se it makes the valgrind output more noise and therefor more difficult to parse.
The example output below is from rational.pyx. The function initrational is created via Cython (there is no init-method, but that comes out of the creation of the class as far as I can tell):
The exact line from rational.c:10789 is:
if (PyType_Ready(&pyx_type_8rational_Rational) < 0) {__pyx_filename = pyx_f[1]; __pyx_lineno = 126; goto __pyx_L1;}
It mentions line 126 which in rational.pyx is:
cdef class Rational(sage.structure.element.FieldElement):
So can be dereference the class somehow upon exit? Looking at valgrind-sessions from python it appears that this is possible because otherwise there would be a large number of leak dictionaries from the buildin c-libraries.
Cheers,
Michael
Component: memleak
Issue created by migration from https://trac.sagemath.org/ticket/557