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

Re: r11556 causes enormous fsfs memory use

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-11-02 21:54:22 CET

Peter N. Lundblad wrote:
> On Tue, 2 Nov 2004, Julian Foad wrote:
>>Branko Čibej wrote:
>>>Peter N. Lundblad wrote:
>>>>It apperas that apr_hash_set() allocates memory for each call that isn't a
>>>>delete, even if there is an entry in the table already.
>>>
>>>Then that's an APR bug. Sure, we should work around it in SVN, but it
>>>needs fixing in APR, too.
>>
>>Is this still thought to be a bug in APR?
>
> Actually, when I read the code mroe carefully, it allocates a new entry
> when inserting a new entry. This isn't a bug. Our use in this case was to
> insert, remove, insert, remove etc. This caused the leak.

 From my reading of the implementation of apr_hash_set(), a sequence of insert,
remove, insert, remove etc. would not cause the hash table to expand (except
perhaps once, on the very first insertion).

I therefore assume the leak was in Subversion, and not in APR.

> I think it would be too much to require APR to cache deleted entries.

That would be an unreasonable expectation - but I don't quite see the
relevance. Note that APR hash tables are responsible only for storing pointers
to your data, not for allocating memory for your data.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 2 21:54:43 2004

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.