Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 3
    There is no guaranty at all that tmp_2 will got the same address. This is implementation dependent details of the underlying allocator. Commented Mar 24, 2014 at 16:07
  • 4
    What about valgrind.org Commented Mar 24, 2014 at 16:07
  • 2
    Also I am aware that one must deallocate all the allocated resources and nothing should be left unaccounted for How about using constructs that do this work automatically, such as containers and smart pointers? Commented Mar 24, 2014 at 16:17
  • What about using a comparison of memory use before and after creating the class under test instance(s) and then again after calling the class under test destructor(s)? A quick Internet search has found this site for multiple platform methods to find memory in use: C/C++ tip: How to get the process resident set size - physical memory use. Commented Mar 24, 2014 at 16:19
  • You should have told us what IDE you use. Try vld.codeplex.com for Microsoft Visual studio projects. Microsofts built in leak detector sucks. Commented Mar 24, 2014 at 17:05