M
mosaic
Hi, all
I really interested in how to check the memory leak of a program.
Your smart guys, do you have excellent ideas that could share with me?
Thank you.
The following is my idea:
In C programming language, there's a "malloc", there must a "free",
my solution of the detection of leak is, find the corresponding "free"
of "malloc". This the first condition.
Another one is much more difficult, the lost of a pointer. I think,
once a pointer is defined, it should be registered. Any operations on
pointer, like assigned or "free", all the operation must be recorded!
So, we can find the lost of pointer and return to programmers.
This is code-based detection.
Application-based detection needs asm knowledge, I will try it then.
Need your comments and advice. Thank you!
I really interested in how to check the memory leak of a program.
Your smart guys, do you have excellent ideas that could share with me?
Thank you.
The following is my idea:
In C programming language, there's a "malloc", there must a "free",
my solution of the detection of leak is, find the corresponding "free"
of "malloc". This the first condition.
Another one is much more difficult, the lost of a pointer. I think,
once a pointer is defined, it should be registered. Any operations on
pointer, like assigned or "free", all the operation must be recorded!
So, we can find the lost of pointer and return to programmers.
This is code-based detection.
Application-based detection needs asm knowledge, I will try it then.
Need your comments and advice. Thank you!