[IronPython] Bug fixes in Ipy 2.6.1

Idan Zaltzberg idan at cloudshare.com
Thu Feb 18 11:57:51 CET 2010


Hi,

In Ipy 2.6 there some issues of memory leak when using generator methods.

I downloaded Ipy 2.6.1 RC1 and indeed most of them were fixed.

Still, one issue still remains the same but I'm not entirely sure this is a
real bug:

The following code shows that in some cases, some memory is not released
even after GC, is that ok?



       def coroutine():

            just_numbers = range(1,1000000)

            def inner_method():

                return just_numbers

            yield None

            raise Exception("some exception") # comment out this line to
make the test not work

        from System import GC

        def get_memory():

            for _ in xrange(4):

                GC.Collect()

                GC.WaitForPendingFinalizers()

            return GC.GetTotalMemory(True)/1e6

        before = get_memory()

        crt = coroutine()

        try:

            crt.next()

            crt.next()

        except:

            pass

        crt = None

        after = get_memory()

        self.assert_(after-before > 10,'There should be a memory leak in
this case.before=%s after=%s' % (before,after))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100218/81893e92/attachment.html>


More information about the Ironpython-users mailing list