GUIDE: Compiling xcn wallet with TCMALLOC allocator.
The fastest malloc we’ve seen; works particularly well with threads
and STL.
This fix eventual memory leaks and improve overal stability and performance.
1. Download and compile TCMALLOC
sudo apt-get install libunwind-dev
git clone https://github.com/gperftools/gperftools
cd gperftools/
./autogen.sh
./configure CFLAGS="-O3 -march=native" CXXFLAGS="-O3 -march=native" --prefix=/usr
make -j4
make install
2. Compile xcn wallet with TCMALLOC library
git clone https://github.com/pallas1/Cryptonite
cd Cryptonite
./autogen.sh
./configure CFLAGS="-O3 -march=native -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" CXXFLAGS="-O3 -march=native -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" CRYPTO_LIBS="-lcrypto -ltcmalloc"
make -j4
Then check, that cryptonited linked with TCMALLOC :
ldd src/cryptonited
linux-vdso.so.1 => (0x00007ffd6abe4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6164a87000)
libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f6164883000)
libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007f616466a000)
libboost_program_options.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.58.0 (0x00007f61643ec000)
libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f61641c6000)
libdb_cxx-4.8.so => /usr/lib/libdb_cxx-4.8.so (0x00007f6163e21000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f6163ba1000)
libssl.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 (0x00007f6163939000)
libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 (0x00007f61634ec000)
libtcmalloc.so.4 => /usr/lib/libtcmalloc.so.4 (0x00007f61630f2000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6162d70000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6162a66000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6162850000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6162486000)
/lib64/ld-linux-x86-64.so.2 (0x000056455c3f5000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f616227d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6162079000)
libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f6161e5d000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6161c3b000)
This string must exist :
libtcmalloc.so.4 => /usr/lib/libtcmalloc.so.4
I checked CPU usage of new allocator with valgrind: