robertwb / issues-import-test

0 stars 0 forks source link

cpdef memory leak #50

Closed robertwb closed 8 years ago

robertwb commented 8 years ago

Reported by robertwb on 16 Jul 2008 07:04 UTC

On Jul 7, 2008, at 8:37 PM, Guillaume Chereau wrote:

Hello all,

I am currently using cython for a project related to openmoko cell
phone : http://charlie137-2.blogspot.com/2008/07/introducing-tichy.html

I noticed that the memory is constantly increasing when I use cython. I
tracked down the problem to the case where I create a subclass of a
cython class and then redefine a cpdef method, asking it to call the
parent method, but ONLY if the cpdef method then call an other cpdef
method !

Here is the smallest example I could come with that fails :

== test.pyx ==

cdef class A:
    cpdef func(self):
        return

    cpdef test(self):
         self.func()

== main.py ==

import test
import gc

class B(test.A):
    def test(self):
        test.A.test(self)

b = B()

for i in range(10):
    b.test()
    gc.collect()
    print len(gc.get_objects())

The output will show that some objects are not released.

Is it a known bug ? Is there a way to avoid it ?

Migrated-From: http://trac.cython.org/ticket/24

robertwb commented 8 years ago

Comment by robertwb on 16 Jul 2008 10:43 UTC http://hg.cython.org/cython-devel/rev/f612fb161cd0

robertwb commented 8 years ago

Modified by robertwb on 19 Aug 2008 04:05 UTC