工具:
LeakFinderC.exe
用法:
LeakFinderC dumpFile leakCandidateFile symbolFile [falseAlarmFile]
常见错误:
- 由于某些原因新加的代码导致原有的申请空间没有被释放
- 虽然改好了,但看不出原因。。。(should be a false alarm?)
几点感想:
-
Smart point is not silver bullet. 其实它并没有解决问题,只是转移了问题。
-
用智能指针其实更具迷惑性。因为智能指针本身也要申请内存。这样我们除了要关注智能指针包含的指针的内存管理,还要留意智能指针本身申请的内存什么时候释放
-
用了智能指针程序可读性更差