| View All Microsoft Windowsce Embedded Posts Ask A New Question |
|
Memory Leak in WM application ?? - RahulPShukl |
Monday, June 09, 2008 8:44 AM
|
Hello Experts,
In my application (WinCE\WM\Pocket PC based) I am getting a severe memory
leak. I am nowhere allocating memory dynamically (no use of new/delete or
malloc/free). Application is in DLL form. So when ever I am invoking that DLL
and running the application, it leaves some memory behind. And if I run the
application in loops, it keeps consuming memory.
There are some points I would like to clear:
1. I have heard in one blog that use of CString variable can cause of memory
leak, though used as a local variable. Is it true??
2. If a CString variable is globally defined as static, so after coming out
from DLL, will the memory allocated to it destroyed?? Or I need to handle it
explicitly, how??
3. What are the tools which I can use to detect memory leak? |
 |
| |
|
|
I tried to detect the leak via Application verifier, but not able to - RahulPShukl |
Monday, June 09, 2008 9:06 AM
|
I tried to detect the leak via Application verifier, but not able to
understand the log generated by that.
any other tool, which can reach me to the buggy code ???
- Rahul |
 |
3. Entrek TOOLBOX should be able to do it. - Paul G. Tobey [eMVP] |
Monday, June 09, 2008 11:10 AM
|
3. Entrek TOOLBOX should be able to do it. It's a high-level tool that will
show you a log of unfreed allocations and allow you to click on one, opening
the corresponding source code. At a guess, though, you should look for
*handles* that you've allocated and not freed. I almost never have a
problem with actual dynamic memory allocation because I know that I have to
be careful about freeing them. Handles, however, don't invoke that same
care. You might also check any API calls that return you an array of
information, as you're almost certainly responsible for freeing that.
Paul T. |
 |
|
|
|
| Previous Microsoft Windowsce Embedded conversation. |