c/c++中类似于java jprofiler/eclispe memoryanalysis的性能瓶颈以及内存泄露分析工具
2023-09-27 14:28:34 时间
visual studio有自带的,可以看MSDN,不过一般来说,我们比较关注linux下的,搜了下,比较好用的应该有gprof和valgrind(可以分析内存潜在的泄露,如针对json-c/log4c进行分析),先记录。可参考如下:
http://blog.csdn.net/clarstyle/article/details/41747817?utm_source=itdadao&utm_medium=referral
http://gernotklingler.com/blog/gprof-valgrind-gperftools-evaluation-tools-application-level-cpu-profiling-linux/
对于性能分析,推荐gcc perf命令行工具(https://zhuanlan.zhihu.com/p/186208907,使用上这个更合适),没有之一。
perf record -a --call-graph dwarf -p PID
perf report
上述命令生成的就是调用链。
# To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 411K of event 'cycles:uppp' # Event count (approx.): 415626554486 # # Children Self Command Shared Object Symbol # ........ ........ ....... .................. ....................................... # 86.20% 7.98% lightdb lightdb [.] ReadBuffer_common | |--80.75%--ReadBuffer_common | | | --80.75%--BufferAlloc (inlined) | | | |--38.27%--StrategyGetBuffer | | | | | --37.50%--GetBufferFromRing (inlined) | | | | | |--14.59%--GetCurrCandidateNums | | | | | | | --11.59%--GetPgwrCandidateNums (inlined) | | | | | | | --0.89%--pg_atomic_read_u64 (inlined) | | | pg_atomic_read_u64_impl (inlined) | | | | | |--9.72%--LockBufHdr | | | | | | | |--8.18%--pg_atomic_fetch_or_u32 (inlined) | | | | pg_atomic_fetch_or_u32_impl (inlined) | | | | | | | --0.54%--init_spin_delay (inlined) | | | | | --3.85%--pg_atomic_read_u32 (inlined) | | pg_atomic_read_u32_impl (inlined)
perf使用可参见:https://blog.csdn.net/jasonactions/article/details/109332167、https://perf.wiki.kernel.org/index.php/Main_Page
后面再专门针对性的研究。
相关文章
- 从c++到Java,关于Java面向对象基础的学习(二)
- Java与C++Socket通讯注意事项
- c++中继承和java中继承的对比
- Python、R、Java、 C++ 等:从业界反馈看机器学习语言趋势
- Effective Java 第三版——31.使用限定通配符来增加API的灵活性
- C++中的类型判断typeid()操作与java中的 instanceof 做比较
- 从C++到java
- 【Java资源免费分享,网盘自己拿】
- Java採用JNI调用VC++生成的dll(Java与C++交互)
- Java 访问 C++ 方法 JavaCPP
- java报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- JSON总结(java篇)
- Java日志框架:logback详解
- 关于Java与c++隐藏、重写不同实现机制的探讨
- request url /product/onShelf method PUT cause by JSON parse error: Cannot deserialize instance of `java.util.ArrayList<com.efivestar.training.model.dto.product.ProductOnShelfReqDTO>`
- Java 泛型
- Java使用路径通配符加载Resource与profiles配置使用
- 【Java笔记】网络编程
- 4种Java引用浅解
- Open Inventor Toolkit for JAVA~.NET~C++特殊版终于解开了
- C/C++,java开源数学计算库
- java JNI 的实现(2)-java和C/C++的相互调用.
- Writing a simple Lexer in PHP/C++/Java
- 论Java的ArrayList.add(e)和C++的vector.push_back(e)的区别
- Java使用Lombok详解
- java 32位MD5加密的大写字符串
- Java:CAS(乐观锁)
- Linux Eclipse代码提示功能设置(Java & C/C++)