[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Memory and Handle Leak using bdb and paged result do not work with ldbm (ITS#3356)
Hi,
This one concerns only to the bdb handle and memory leak.
Can anyone give me a hint where to start clearing the bdb cache or
limiting it?
The back-bdb holds a cache that is built out of bdb_entry_info structs.
Each struct contains a bei_kids_mutex, that is initialised in
bdb_cache_entryinfo_new: ldap_pvt_thread_mutex_init(
&ei->bei_kids_mutex );
It is destroyed in bdb_cache_entryinfo_destroy:
ldap_pvt_thread_mutex_destroy( &e->bei_kids_mutex );
The bdb_entry_info items are kept in the list even if the cachsize is set
to a low value. I debugged with a cachesize of 10 to find out if the
entries in the cache would not grow.
If the actual cache size (bdb->bi_cache.c_cursize) reaches
bdb->bi_cache.c_maxsize, the entry is removed only from the LRU, but not
from the cache.
The problem I metioned (handle leak) is not really a leak, the handles get
freed during shutdown of the server (bdb_cache_release_all).
It´s just if you are adding some entries using ldap_add, lets say some
100000 entries, the handle count increases to that values and never get
freed until the server shuts down.
Can you explain me, why the entries remain in the cache (even if they are
deleted from the lru cache)? Any idea how to keep the cache (and the used
handles) small?
Best regards,
Stephan Eckbauer
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
For more information, connect to http://www.F-Secure.com/