[Date Prev][Date Next]
(ITS#6660) paged result searches fail to deallocate memory until slapd shutdown
- To: openldap-its@OpenLDAP.org
- Subject: (ITS#6660) paged result searches fail to deallocate memory until slapd shutdown
- From: firstname.lastname@example.org
- Date: Tue, 28 Sep 2010 17:08:19 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Full_Name: Quanah Gibson-Mount
OS: Linux 2.6
Submission from: (NULL) (18.104.22.168)
When using paged result searches with large databases, it quickly becomes
apparent that slapd is failing to deallocate memory allocated during those
searches once they complete. The example database I am using has 6,326,513
entries, and is some 8.5GB on disk (id2entry.bdb + dn2id.bdb).
What has been found is that over time when using multiple paged results
searches, slapd's memory continually grows until it eventually consumes all
memory on the system. Once slapd is stopped, the allocated memory is freed.
This behavior can be seen in a more pronounced fashion by running multiple paged
results searches and searches of the full database simultaneously.
For example, I start slapd, and preload all the caches by doing 4 full searches
of the database. At this point, top reports (V/R/S):
I then start 10 ldap searches dumping the full database (using root dn), and 10
paged result searches that only return some 2.6 million entries. After these
all complete, I run this sequence again. Instead of slapd's memory remaining
stable (i.e., re-using all the memory it had previously allocated), it instead
continues to grow. At the end of just 2 of these runs, we end up at:
Or a 10.3GB growth in virtual memory and 10GB growth in resident memory.
As soon as slapd is halted, all of this memory is freed (Making it impossible to
track this via valgrind).
I'm currently using the heap profiler shipped with tcmalloc to gather further
information and will follow up when that is complete.