[omniORB] memory leak in omniNames with python
Mathieu de Naurois
denauroi@in2p3.fr
Fri, 05 Oct 2001 17:51:16 +0200
Well, your explaination is convincing, but
if I tried your modified script, the memory used by omniNames
still increases.
Cheers,
Mathieu
Duncan Grisby a =E9crit :
> On Friday 5 October, Mathieu de Naurois wrote:
>
> > My omniNames server is leaking memory when I list the content of a
> > context from python.
>
> [...]
> > l =3D rootContext.list(100)
> > del l
>
> The list() operation is declared in IDL as
>
> void list(in unsigned long how_many,
> out BindingList bl,
> out BindingIterator bi);
>
> That means the return value in Python is a tuple of the two out
> values: the list and a reference to a BindingIterator object.
>
> In the case that list() returns all the bindings in a single call,
> there is no need for the iterator. The Naming service specification
> allows the server to return a nil object reference, but it doesn't
> have to. omniNames currently always returns an iterator, even if it's
> useless.
>
> So, the leak you are seeing is the BindingIterator. You should call
> its destroy() operation to clean it up properly:
>
> bl, bi =3D rootContext.list(100)
> if bi is not None:
> bi.destroy()
>
> Cheers,
>
> Duncan.
>
> --
> -- Duncan Grisby \ Research Engineer --
> -- AT&T Laboratories Cambridge --
> -- http://www.uk.research.att.com/~dpg1 --
--
Mathieu de Naurois
LPNHE - IN2P3 - CNRS - Universit=E9s Paris VI et Paris VII
4 place Jussieu
Tour 33 - Rez de chauss=E9e
75252 Paris Cedex 05
email: denauroi@in2p3.fr
tel : 01 44 27 23 24
fax : 01 44 27 46 38