- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm evaluating Intel Inspector for our project at my work and it is failing to find simple memory leaks I've added as a test.
For example, I added the following code to our project and it is not reported on any run level of memory analysis in Intel Inspector.
char* MyString = new char[1111];
LOG_EVENT("LEAKING MEMORY HERE!")
However, if I put this in a dummy project, Intel Inspector finds the leak properly. The only thing I can think is that our project has slightly different build settings, namely the Code Generation/Runtime Library is set to /MTd as opposed to /MDd. However, even in my dummy project setting this does not have any effect on Intel Inspector's ability to find such blatant errors. Is there anything else I should be looking for in my project that would keep Intel Inspectorfrom finding errors?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that this is most likely to happen if the block is allocated early in the process, i.e., close to the start of main(). If you try adding said code to some sub-functions, you may find the leaks are more reliable reported.
Something else that might work for this case of leak detection is to use something like GlobalAlloc() or LocalAlloc().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The intentional memory leak code I added was in the constructor of a class that is created a single time on the run of my program.
After my post yesterday, I changed my project to do code generation via /MDd switch. On the first run of Intel Inspector it found all memory errors I had added at the "Detect Leaks" memory analysis level. I then removed most of the errors I had intentionally added and re-ran Intel Inspector on the "Detect Leaks" memory analysis level and it found 0 errors, missing 3 errors I had intentionally added. I then ran at the "Detect Memory Problems" level with Intel Inspector and it found all memory errors I had injected. Based on the options and their descriptions this seems odd to me as I thought the leaks would be caught on the first level as they previously were found when I had more errors.
Anything I can look for to explain the inconsistency of finding my memory errors?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page