tcmalloc is a memory allocator developed by Google. It has the basic characteristics of a modern memory allocator: resisting memory fragmentation and being able to scale on multi-core processors. Using tcmalloc can also effectively reduce the memory usage of rocksdb.
- Enter the exchange directory.
- Install tcmalloc, the process will take a few minutes to install tcmalloc to your system, the installation command is as follows:
- Compile exchaind link tcmalloc, the command is as follows:
make mainnet OKCMALLOC=tcmalloc
- Check whether the link has been successful,
| grep malloc
If the link has been normal, there will be the following output
- Start the node
If you do not want exchaind to dynamically link tcmalloc, you need not specify the OKCMALLOC parameter during the compilation of the node. The command is as follows: