By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,044 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,044 IT Pros & Developers. It's quick & easy.

Memory allocation

P: 2
Hi,
can anyone tell how to precisely detect memory leak scenario's in large application programs without using tools like purify,valgrind etc.
memory leaks physical memory leaks.

what are other scenarios apart from these mentioned below

1->writing beyond array
2->not freeing dynamically allocated
3->using freed memory
etc

soth
Sep 21 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
1->writing beyond array
3->using freed memory
Neither of these are memory leaks, they are memory corruptions (sometime colloquially known as "stamping on memory").

The only way to get a memory leak is to fail to release memory allocated with malloc, calloc or new.

Detecting it in a large project is very hard without without getting a memory checker like the ones you mention.

In MSVC running a program in debugging mode it will detect memory leaks when the program exits. You can use the information provided to locate where the leaked memory was allocated.
Sep 21 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.