ChinaUnix.net
相关文章推荐:

valgrind 内存错误类型

#include #include int main() { char buff[4][5]={0}; int i=0; for (i = 0; i < 7; i++){ printf("input one string %d\n", i+1); scanf("%s", buff); } for (i = 0; i < 5; i++){ printf("string %d %s\n", i+1, ((char*)buff)+(i*5)); } for (i = 0; i < 5*4; i++){ printf("%d %d \n", i, *((char*)buff+i) ); } } 测试...

by benjiam - C/C++ - 2007-07-18 22:55:41 阅读(1235) 回复(0)

相关讨论

valgrind检查内存泄漏, 如下: 2,448 bytes in 17 blocks are possibly lost in loss record 34 of 37 ==12744== at 0x4023492: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) ==12744== by 0x4010D38: (within /lib/ld-2.8.so) ==12744== by 0x4010DFB: _dl_allocate_tls (in /lib/ld-2.8.so) ==12744== by 0x40409D9: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.8.so) ==12744== by 0...

by ruchong - C/C++ - 2009-06-09 14:36:50 阅读(2699) 回复(3)

valgrind是一个GPL的软件,用于Linux(For x86, amd64 and ppc32)程序的内存调试和代码剖析。你可以在它的环境中运行你的程序来监视内存的使用情况,比如C 语言中的malloc和free或者 C++中的new和 delete。使用valgrind的工具包,你可以自动的检测许多内存管理和线程的bug,避免花费太多的时间在bug寻找上,使得你的程序更加稳固。 valgrind的主要功能 valgrind工具包包含多个工具,如Memcheck,Cachegrind,Helgrind, Callgrind,...

by benq_8011 - AIX文档中心 - 2008-04-15 10:03:46 阅读(2966) 回复(0)

==2251== 4 bytes in 1 blocks are still reachable in loss record 3 of 152 ==2251== at 0x401AC0F: operator new(unsigned) (vg_replace_malloc.c:163) ==2251== by 0x80DE6F9: CSysConf::CSysConf() (csysconf.cpp:21) ==2251== by 0x805CCDA: CComManager::CComManager() (ccommanager.cpp:17) ==2251== by 0x80E07C9: glbinit() (glbinit.cpp:26) ==2251== by 0x804AE9C: main (cdtele_dps.cpp:34) 说是我CS...

by jsjqzhang - C/C++ - 2007-12-13 17:51:58 阅读(2127) 回复(4)

最近写了一个小程序,除了一开始的访问数据库获得数据源以外基本就是纯cpu计算。由于某种原因采用了pascal写的,其实就是在redhat+kylix环境。现在内存泄露比较严重。程序刚启动的时候大概占用十几兆内存,一分钟以后就涨到了20兆。不知道valgrind可不可以检测pascal的内存泄露么?只要检测到是大概是那个函数就可以了。如果有其他的可以检测pascal内存泄露的工具,麻烦您告知。谢谢

by UnixStudier - C/C++ - 2007-04-26 16:13:36 阅读(1242) 回复(2)

valgrind如何检测.SO .LIB的共享内存情况

by amybb - C/C++ - 2004-09-17 12:00:44 阅读(1518) 回复(0)

Invalid read of size 4 ==17931== at 0x80495F9: G_Epoll::waitEpoll() (epl.cpp:136) ==17931== by 0x804C45C: G_Socket::Run() (Socket.cpp:123) ==17931== by 0x804BE7E: G_Thread::threadFun(void*) (Thread.cpp:34) ==17931== by 0x404118A: start_thread (in /lib/libpthread-2.6.1.so) ==17931== by 0x423004D: clone (in /lib/libc-2.6.1.so) ==17931== Address 0x0 is not stack'd, malloc'd or (recent...

by ruchong - C/C++ - 2008-01-16 19:57:13 阅读(1973) 回复(3)

大家好,我是一个新手,请大家帮帮忙,谢谢! 我的操作系统是suse10.1,运行一个程序时,屏幕输出“Segmentation fault”,然后就退出了。 于是我运行valgrind进行检查,却没有得到任何error,下面是部分的valgrind输出结果: Total NVRAM usage is 88392 out of 131008 bytes ERROR SUMMARY: 0 errors from 0 contexts(suppressed: 19 from 1) malloc/free: in use at exit:282,233 bytes in 708 blocks malloc/free: 1,352 allo...

by btwo0 - C/C++ - 2007-05-11 16:47:29 阅读(2704) 回复(3)

请问 如何用valgrind 检查后台服务进程的内存使用情况? 谢谢!

by lc1999 - C/C++ - 2011-04-07 16:00:15 阅读(7134) 回复(6)

1。 安装完valgrind, 随手测试了一下,结果发现: >;>;valgrind ls ==9886== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 30 from 1) ==9886== malloc/free: in use at exit: 12801 bytes in 66 blocks. ==9886== malloc/free: 243 allocs, 177 frees, 42577 bytes allocated. ==9886== For counts of detected errors, rerun with: -v ==9886== searching for pointers to 66 not-freed blocks. ==9886== checked 172...

by soararing - C/C++ - 2005-08-23 10:56:57 阅读(1333) 回复(2)

valgrind --tool=memcheck --leak-check=full xxx(进程名) top 观察该进程的内存总是13m, 这总现象如何解释? ps: 直接启动该demon进程后,随着时间增长,该进程内存使用不断上涨。

by doofy - C/C++ - 2009-01-19 16:21:38 阅读(1484) 回复(0)