11.10. Tcmalloc

'tcmalloc' is a library Google created as part of the google-perftools suite for improving memory handling in a threaded program. It's very simple to use and does work fine with Suricata. It leads to minor speed ups and also reduces memory usage quite a bit.

11.10.1. Installation

On Ubuntu, install the libtcmalloc-minimal4 package:

apt-get install libtcmalloc-minimal4

On Fedora, install the gperftools-libs package:

yum install gperftools-libs

11.10.2. Usage

Use the tcmalloc by preloading it:


LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4" suricata -c suricata.yaml -i eth0


LD_PRELOAD="/usr/lib64/libtcmalloc_minimal.so.4" suricata -c suricata.yaml -i eth0