xinyiZzz opened a new pull request, #42059: URL: https://github.com/apache/doris/pull/42059
Now Doris needs to restart the BE process every time to analyze the Jemalloc heap profile, and dump the profile file first, and then use `jeprof` to analyze the profile file to generate a dot graph. This PR will allow the jemalloc heap profiler to be dynamically start or stop during BE runtime, and can directly return to the profile dot graph. 1. start heap profiler ``` curl http://{be_ip}:8040/jeheap/active/true ``` ``` heap profiler started Jemalloc will only track and sample the memory allocated and freed after the heap profiler started, it cannot analyze the memory allocated and freed before. Therefore, dumping the heap profile immediately after start heap profiler may prompt `No nodes to print`. If you want to analyze the memory that has been allocated in the past, you can only restart the BE process and start heap profiler immediately. ``` 2. stop heap profiler ``` curl http://{be_ip}:8040/jeheap/active/false ``` ``` heap profiler stoped ``` 3. dump heap profile and format to dot ``` curl http://{be_ip}:8040/jeheap/dump ``` ``` perl: warning: Setting locale failed. ...... addr2line: Dwarf Error ...... digraph ....... ------------------------------------------------------- Copy the text after `digraph` in the above output to http://www.webgraphviz.com to generate a dot graph. If there are many errors: `addr2line: Dwarf Error`,Reference Documentation: https://doris.apache.org/community/developer-guide/debug-tool/#4-qa ``` ``` ``` 4. only dump heap profile ``` curl http://{be_ip}:8040/jeheap/dump_only ``` ``` jemalloc heap dump success, dump file path:xxxx ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org