由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 面试问题C++ memory leakage
相关主题
interview question: make all class member functions virtual (转载)请问如何才能对binary tree的题大小通吃?
请问大家一个eclipse CDT的问题 (转载)[合集] 请问binary searth tree的遍历问题。
有什么窍门让purify快一些?[合集] 讨厌的WARNING: 在 MANAGED C++ 中写东东
C++ questions[合集] C++ i/o
请教问题有没有现成的模拟fread的bufferRead()?
求推荐方便编程的平板C++ ofstream binary output slow
How to read binary(data) file generated by Fortran in C/C++ (转载)一个 C++ STL base type 的问题
有人知道Sedgewick的算法书最后那几part什么时候出吗?关于多线程锁:锁代码还是锁资源?
相关话题的讨论汇总
话题: detect话题: c++话题: memory话题: tools话题: leak
进入Programming版参与讨论
1 (共1页)
w*****n
发帖数: 9
1
How to detect memory leak and how to resolve it in C++?
如何回答比较好?
r********n
发帖数: 7
2
overload了new和delete来做个profiler?
r*******y
发帖数: 290
3
auto_ptr?

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

s****u
发帖数: 118
4
1. 眼睛
2. 工具

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

y*******g
发帖数: 6599
5
盖头~?

【在 s****u 的大作中提到】
: 1. 眼睛
: 2. 工具

s****u
发帖数: 118
6
hi

【在 y*******g 的大作中提到】
: 盖头~?
a****l
发帖数: 8211
7
if you can't detect it, it's probabily small and can leave it alone. if it
is serious, you can detect it immediately.

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

p*****o
发帖数: 7
8
Depending on which platform you are developing on, there are different
memory profilers that can help you find leaks. On windows you can use
boundschecker, on Linux you can try valgrind. Microsoft also provides some
facilities. Do a search on MSDN if you are on windows platform. One of the
drawbacks is that when you run your programs with these tools, sometimes the
performances are very poor, so they may or may not work for you.
If you don't have access to any of these tools, you can overload ne

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

r*******t
发帖数: 8550
9
Very good question.
Should answer as two questions: 1) how to detect, and 2) how to resolve
1) unit test with detection software (perfmon or purify or bouncecheck or ..)
2) lot of difference answers:
2A) read lines to check new/delete pair, sometimes you could draw complete state machines for every new/memory_allocation operations to verify the match of delete operation
2B) tools (most tools overload new/delete with in-process or out-process data collection with source lines/call stacks, like bo

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

s****u
发帖数: 118
10
.....

【在 r*******t 的大作中提到】
: Very good question.
: Should answer as two questions: 1) how to detect, and 2) how to resolve
: 1) unit test with detection software (perfmon or purify or bouncecheck or ..)
: 2) lot of difference answers:
: 2A) read lines to check new/delete pair, sometimes you could draw complete state machines for every new/memory_allocation operations to verify the match of delete operation
: 2B) tools (most tools overload new/delete with in-process or out-process data collection with source lines/call stacks, like bo

L*********r
发帖数: 92
11
tool is good but it just 2 lines of code to add the functionality to detect
memory leak in vc++.
r*******t
发帖数: 8550
12
If your program is big and it never exist/quit in a normal and orderly
manner(for example, i was working in a big project whose compiled binaries
total 700MB, and the program could only be KILLED, not quited), VC++ couldn'
t detect.

detect

【在 L*********r 的大作中提到】
: tool is good but it just 2 lines of code to add the functionality to detect
: memory leak in vc++.

L*********r
发帖数: 92
13
you can make check point and dump memory leak whenever you prefer in vc++.
tool should be easier to use but not always necessary

couldn'

【在 r*******t 的大作中提到】
: If your program is big and it never exist/quit in a normal and orderly
: manner(for example, i was working in a big project whose compiled binaries
: total 700MB, and the program could only be KILLED, not quited), VC++ couldn'
: t detect.
:
: detect

d*******d
发帖数: 2050
14
1. tools, such as purify/memprof....
2. design a memory pool to manage the memory.
3. good habbit.

【在 w*****n 的大作中提到】
: How to detect memory leak and how to resolve it in C++?
: 如何回答比较好?

1 (共1页)
进入Programming版参与讨论
相关主题
关于多线程锁:锁代码还是锁资源?请教问题
ZK框架用处大吗?求推荐方便编程的平板
OSGI到底是干什么用的?How to read binary(data) file generated by Fortran in C/C++ (转载)
binary ops in Matlab有人知道Sedgewick的算法书最后那几part什么时候出吗?
interview question: make all class member functions virtual (转载)请问如何才能对binary tree的题大小通吃?
请问大家一个eclipse CDT的问题 (转载)[合集] 请问binary searth tree的遍历问题。
有什么窍门让purify快一些?[合集] 讨厌的WARNING: 在 MANAGED C++ 中写东东
C++ questions[合集] C++ i/o
相关话题的讨论汇总
话题: detect话题: c++话题: memory话题: tools话题: leak