换上jemalloc
Compile your application with jemalloc by linking it with the jemalloc library. You can do this by adding -ljemalloc to your linker flags.
Set the MALLOC_CONF environment variable to enable profiling and leak detection. Here’s an example command:
export MALLOC_CONF=prof:true,prof_leak:true
Run your application as you normally would.
Check the leak report generated by jemalloc. You can use the jeprof tool to analyze the report and identify memory leaks.
The leak report generated by jemalloc is stored in a file named heap.profile
--
FROM 61.185.159.*