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

Re: SVN::Client -- why does this leak?

From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2006-11-10 09:27:41 CET

Garrett Rooney wrote:
> The problem is that since you're creating the $ctx before the pool
> it's allocated in whatever the default pool is at the time (probably
> the global pool), and thus the underlying svn_client_ctx_t will not be
> cleaned up until the global pool is cleared. If you reverse the two
> statements the $ctx gets created inside your new pool, so it gets
> cleaned up when your clear() gets run. Actually, even without the
> clear() it'd still get cleaned up when $pool fell out of scope.

Ah. So if I have a pool, create an object of type A in it, delete that
object, and then create a second object of type A in the pool, the pool
won't reuse the memory allocated for the first object, and will instead grow
in size?

That certainly matches the behaviour that I'm seeing -- I just hadn't
realised that subtlety of pool management.

Ta.

N

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 10 09:28:03 2006

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.