我正在运行一个与tcmalloc链接的二进制文件,它没有为检测到的泄漏生成堆栈跟踪。
The output says:
The 1 largest leaks:
Leak of 1401231 bytes in 82093 objects allocated from:
If the preceding stack traces are not enough to find the leaks, try running THIS shell command:
pprof ../../prog "/tmp/prog.15062.prog-end.heap" --inuse_objects --lines --heapcheck --edgefraction=1e-10 --nodefraction=1e-10 --gv当我运行pprof时,我得到一条消息,告诉我没有要打印的节点。
我将包含有疑似内存泄漏的代码。
HeapLeakChecker checker("prog");
....
assert(checker.NoLeaks());对如何调试这个有什么想法吗?
发布于 2013-01-15 01:49:07
我建议尝试使用-fno-omit- frame -pointer (gcc)来构建程序,因为在某些设置中可能需要使用帧指针来获取堆栈跟踪。
tcmalloc通常使用libunwind来获取堆栈跟踪,但由于死锁问题,并不是所有地方都可以使用。
一个有趣的信息是所生成的文件(在本例中为/tmp/proc.15062.prog-end.heap)是否包含一些地址。
https://stackoverflow.com/questions/10818825
复制相似问题