[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Memory Leak in slapd (or did I miss something configuring?)



--On Wednesday, August 31, 2011 11:33 AM +0200 Thomas Rasmussen <rasmussen.thomas@gmail.com> wrote:


After a restart and performing a ldapsearch slapd has allocated over
500MB of memory, which is not exactly a good thing :-(

How many total entries are in your database? What is your entrycache size? I don't see that information in your stripped slapd.conf. Personally, I suggest you never "strip" slapd.conf when sending it out, because you aren't necessarily going to know what is relevant to what you are doing.

I think you are misunderstanding some of how OpenLDAP works. In addition to the BDB cachesize (which you have configured as 50MB (which is likely grossly small given the size of your database), there are also 3 additional caches for back-bdb/back-hdb in slapd itself. Those are *not* filled until you start doing searches. Those 3 caches are:

entrycache
idlcache
dn cache

My guess is it is growing to 500MB of memory because it is filling up the DN cache. Given the 10GB size of your id2entry database, I'm guessing you have a *lot* of DNs.

I.e., the only way you will know the total size of what the slapd process *should* be is to start it, and then do an ldapsearch of the entire database. Once that is finished, you'll get an approximate size of your DB with most of the caches filled (although the idlcache may take more time to fill).

Basically, I don't see 500MB as problematic, given the DB size you reported. However, now that you have tcmalloc in place, the general size of slapd should be significantly more stable.

Finally, I will note that using "db_upgrade" to upgrade an OpenLDAP database has not, and it is unlikely every will be, supported. The *only* supported method of migrating to a newer version of BDB is to slapcat the original database and to slapadd it back in. So it is entirely possible you have created a very interesting issue by doing a completely unsupported operation.

--Quanah



--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra ::  the leader in open source messaging and collaboration