GreateCode opened a new pull request, #2737:
URL: https://github.com/apache/brpc/pull/2737

   ### What problem does this PR solve?
   
   Issue Number: resolve #1962 
   
   Problem Summary: 支持jemalloc profiler
   
   ### What is changed and the side effects?
   
   Changed: 增加jemalloc mallctl和弱符号修饰
   
   用法:
   1. 编译jemalloc需--enable-prof
   2. 启动进程:MALLOC_CONF="prof:true" LD_PRELOAD=/xxx/lib/libjemalloc.so 
./bin/test_server
   3. 可使用FLAGS_je_prof_active在进程running期间开启/关闭采样;
   4. 改变FLAGS_je_prof_dump会dump heap文件;
   5. FLAGS_je_prof_reset可清理已采样数据和重置prof选项,并且动态设置采样率,默认2^19B;
   
   样例:
   
![image](https://github.com/user-attachments/assets/41f48ea5-ed52-4498-8b56-be6abdae29a2)
   
![image](https://github.com/user-attachments/assets/82d10c80-b9ee-45c2-9983-ef76e936a4af)
   
![image](https://github.com/user-attachments/assets/f8031492-447a-4896-8628-949458ebef6d)
   
   
   Side effects:
   - Performance effects(性能影响):
   
   - Breaking backward compatibility(向后兼容性): 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable(请确保你的更改可以通过编译).
   - When providing us with a new feature, it is best to add related 
tests(如果你向我们增加一个新的功能, 请添加相关测试).
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
   


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to