Red Hat Bugzilla – Bug 1301224
[RFE] Alternate memory allocator support (tcmalloc)
Last modified: 2016-11-07 10:39:28 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
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.
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.
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:
 Adding 10k entries
Average rate: 752.00/thr ( 752.00/sec), total: 7520
Average rate: 803.90/thr ( 803.90/sec), total: 8039
 Modifying 10k entries
Average rate: 1272.10/thr (1272.10/sec), total: 12721
Average rate: 1382.00/thr (1382.00/sec), total: 13820
 Searching 10k entries
Average rate: 6851.40/thr (6851.40/sec), total: 68514
Average rate: 6924.20/thr (6924.20/sec), total: 69242
 Deleting 10k entries
Average rate: 712.90/thr ( 712.90/sec), total: 7129
Average rate: 717.60/thr ( 717.60/sec), total: 7176
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.