[patch] python-dbus 0.80.1 memory leak issue
Luka Renko
lure at kubuntu.org
Tue Feb 6 11:28:24 PST 2007
On Monday 5. of February 2007 17:30:04 Simon McVittie wrote:
> On Wed, 31 Jan 2007 at 19:55:03 +0000, Simon McVittie wrote:
> > On Wed, 31 Jan 2007 at 11:58:51 -0500, John (J5) Palmieri wrote:
> > > The first goto will call Py_XDECREF(handler) on a NULL. Does
> > > Py_XDECREF handle NULL's as noops?
> >
> > Yes, that's what the X means. Py_DECREF is the fast unchecked version.
>
> Some more leak fixes attached.
Thanks for those. It does not think to help in my case... :-(
> There's at least one more - if you allocate
> dbus.String objects in a fast loop, memory usage increases over time -
> but I can't see what could possibly be causing it! Perhaps someone else
> could have a look at the String constructor in _dbus_bindings/string.c and
> see if there's something I haven't spotted? The following script reproduces
> it:
>
> #!/usr/bin/python
> import sys
>
> import _dbus_bindings
>
> while True:
>
> x = _dbus_bindings.String('12345rgehruhgeiruhgeiurhgeliurhgeuirh')
> print id(x),
> print sys.getrefcount(x)
> del x
>
> The String always seems to be created and destroyed at the same address,
> which is good, but perhaps its memory buffer isn't being freed correctly or
> something. I'm just delegating to the unicode destructor to do that though,
> so it really ought to work.
Is 0.80.1 so much different than 0.71 that we used in Ubuntu before? It is a
bit strange that this kind of reference accounting issue would be so wide
spread...
Regards,
Luka
More information about the dbus
mailing list