Binaries Linux builds of the libtcmalloc and the libjemalloc libraries.
First you will need to choose the appropriate tar.gz to download. List of ditributions and corresponding tar.gz suffix to use:
To use it with a target application:
- Download the package that fits your Linux distribution and processor.
- Place the library you want to use on a Linux folder accessible by your application.
- Set the environment variable LD_PRELOAD:
LD_PRELOAD=/path/to/a/folder/libmylib.so.1.2.3
- Start your target application.
To check if the library is being used:
- Get the target application PID.
- Execute
grep libmylib.so.1.2.3 /proc/[PID]/maps
. - Verify if there are any lines with libmylib.so.1.2.3 to make sure it's loaded.