[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: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2004-11-02 22:25:51 CET

On Tue, 2 Nov 2004, Julian Foad wrote:

> Peter N. Lundblad wrote:
> > On Tue, 2 Nov 2004, Julian Foad wrote:
> >>Branko Čibej wrote:
> >>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).
>
Let's see if we a) mean the same by insert, remove, ... and b) read the
code the same way:-)

1. hash_set(..., non-NULL): entry not found, allocate.
2. hash_set(..., NULL) (remove): entry found, remove from linked list
3. hash_set(..., non-NULL): entry not found, allocate
...

If you do this, the hash pool will grow for each set. (The above is for
the same key). We can discuss whose leak it was, but it isn't anymore,
since I eliminated that usage.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 2 22:16:28 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.