Bug 1301224 - [RFE] Alternate memory allocator support (tcmalloc)
[RFE] Alternate memory allocator support (tcmalloc)
Product: Red Hat Directory Server
Classification: Red Hat
Component: Directory Server (Show other bugs)
Unspecified Unspecified
high Severity high
: DS10.1
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
Petr Bokoc
: FutureFeature, TestOnly
Depends On:
  Show dependency treegraph
Reported: 2016-01-22 17:12 EST by Nathan Kinder
Modified: 2016-11-07 10:39 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-07 10:39:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
tcmalloc_vs_glibc_add_srch_mod_del.png (41.25 KB, image/png)
2016-10-18 10:11 EDT, Viktor Ashirov
no flags Details

  None (edit)
Description Nathan Kinder 2016-01-22 17:12:32 EST
Jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.

Using the jemalloc library for memory allocation has significantly reduced the memory usage for  389 DS, with no perceptible downside in performance.

We should support using jemalloc for memory allocation as a non-default configuration.

Design Document: http://www.port389.org/docs/389ds/FAQ/jemalloc-testing.html
Comment 1 Viktor Ashirov 2016-07-21 11:26:59 EDT
tail -n 5 /etc/sysconfig/dirsrv
# jemalloc is a general purpose malloc implementation that emphasizes
# fragmentation avoidance and scalable concurrency support.  jemalloc
# has been shown to have a significant positive impact on the Directory
# Server's process size/growth.
#LD_PRELOAD=/usr/lib64/dirsrv/libjemalloc.so.1 ; export LD_PRELOAD

This should be changed to tcmalloc.
Comment 5 Amita Sharma 2016-08-25 10:34:51 EDT
For verification ::

1. yum install gperftools-libs
2. In /etc/sysconfig/dirsrv uncomment LD_PRELOAD=@libdir@/libtcmalloc.so.4  
3. and restart the server
4. Now check :: 

# ps -aef | grep slapd
dirsrv   23745     1  7 19:07 ?        00:00:00 /usr/sbin/ns-slapd -D /etc/dirsrv

# pldd 23745 | grep tcmalloc

Also, http://www.port389.org/docs/389ds/FAQ/jemalloc-testing.html can be used for testing.
Comment 6 Viktor Ashirov 2016-10-18 10:11 EDT
Created attachment 1211761 [details]

Test results with tcmalloc vs glibc malloc:

Memory consumption with tcmalloc was 18-30% lower than using glibc malloc (see attachment)

There is a slight improvement in performance:

[1] Adding 10k entries
Average rate:  752.00/thr  ( 752.00/sec), total:   7520

Average rate:  803.90/thr  ( 803.90/sec), total:   8039

[2] Modifying 10k entries
Average rate: 1272.10/thr  (1272.10/sec), total:  12721

Average rate: 1382.00/thr  (1382.00/sec), total:  13820

[3] Searching 10k entries
Average rate: 6851.40/thr  (6851.40/sec), total:  68514

Average rate: 6924.20/thr  (6924.20/sec), total:  69242

[4] Deleting 10k entries
Average rate:  712.90/thr  ( 712.90/sec), total:   7129

Average rate:  717.60/thr  ( 717.60/sec), total:   7176
Comment 8 errata-xmlrpc 2016-11-07 10:39:28 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.