博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Valgrind: memcheck of memleak/mem-uninitialization; massif usage
阅读量:6604 次
发布时间:2019-06-24

本文共 905 字,大约阅读时间需要 3 分钟。

first install valgrind, its newest ver is 3.11, and stops updating since 2015/12.

in centos, yum installs 3.10 ver.

using valgrind ./buggy.out to execute memcheck tool in valgrind, other useful tools can be found in the man page.

specify --leak-check=full before program will print verbose info about mem-leak's malloc info.

however, valgrind only uses binary file to scan mem-errors, so something like buffer-overrun near the address will likely to be missed.

 said specify -fsanitize=address while compiling using gcc/ver 4.8 or clang will discover this problem(or clang 3.1+..), but seems not working too..

the --tool=exp-sgcheck checks buffer-overrun problems.. from this ..

 

Monitor heap-profiler: using massif tool:

valgrind --tool=massif ./prog.out will produce massive.out.pid file. Using ms_print massive.out.pid to print the result in graph style.

转载于:https://www.cnblogs.com/sansna/p/5981354.html

你可能感兴趣的文章
layer 不居中的坑爹问题
查看>>
input file样式,文件路径、文件名的获取
查看>>
while循环和 do while 的区别
查看>>
android 运行时出现The connection to adb is down, and a severe error has occured.(转)
查看>>
Oracle数据库修改表结构
查看>>
问题:关于贴友一个用js传递value默认值的简单实现
查看>>
Python dict dictionaries Python 数据结构——字典
查看>>
【SICP练习】151 练习4.7
查看>>
MySQL高可用架构之Keepalived+主从架构部署
查看>>
如何在分组时,连接多个行数据
查看>>
Codeforces 1149 B - Three Religions
查看>>
js中的scrollTop、offsetTop、clientTop
查看>>
11-border(边框)
查看>>
4.字符串(2-6/2-7)
查看>>
bugfree3.0.1-邮件配置
查看>>
ASP.Net MVC View(视图)
查看>>
有关git clone 下载速度变慢的解决方法
查看>>
Papervision3D Essentials中文版,附Papervision3D_2.1.920.swc和章节练习源码
查看>>
Mysql汉字乱码的解决
查看>>
FMDB增删改查小Demo
查看>>