[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: python bindings leak memory (Re: 1.7.0-beta1 up for testing)

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 18 Jul 2011 09:09:57 +0100

"rupert.thurner" <rupert.thurner_at_gmail.com> writes:

> On Jul 17, 10:16 pm, Philip Martin <philip.mar..._at_wandisco.com> wrote:
>> "rupert.thurner" <rupert.thur..._at_gmail.com> writes:
>> > now it works ... and running it for 100'000 revisions slowly increases
>> > #!/usr/bin/python
>>
>> > import svn.client
>> > import svn.core
>> > import svn.ra
>>
>> > pool = svn.core.Pool()
>> > client = svn.client.create_context(pool)
>> > client.config = svn.core.svn_config_get_config(None)
>> > client.auth_baton =
>> > svn.core.svn_auth_open([svn.client.get_simple_provider(pool)], pool)
>>
>> > ra = svn.client.open_ra_session("http://gcc.gnu.org/svn/gcc", client,
>> > pool)
>> > def rcvr(orig_paths, rev, author, date, message, pool):
>> >     if orig_paths is not None:
>> >         for x in orig_paths:
>> >             orig_paths[x]._parent_pool.destroy()
>>
>> Destroying pools like that was a workaround for a bug that has been
>> fixed.  It's only safe if nothing uses, or explictily destroys, the
>> pool.
>
> how are the pools correctly destroyed?

According to the issue 3052 it was fixed by r868618:

r868618 | djames | 2007-12-19 01:10:36 +0000 (Wed, 19 Dec 2007) | 11 lines
Fix a major memory leak in the Python object duplication code.

> i tried to use the subversion
> test cases to find a small example for replay, but it seems to be not
> tested at all? is there some documentation you could point to which
> shows how to use replay correctly?

The bindings test coverage is limited, it would help if more tests were
written. The best I can suggest is the C API and the svnsync usage:

http://subversion.apache.org/docs/api/latest/svn__ra_8h.html
http://svn.apache.org/repos/asf/subversion/trunk/subversion/svnsync/main.c

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-07-18 10:10:52 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.