Solved

Tracing memory leaks (using LeakTracer)

Posted on 2003-11-19
3
356 Views
Last Modified: 2013-12-14
Hello, I'm trying to patch up some memory leaks in my program using LeakTracer, but I still don't quite understand where the largest one is coming from.

This is kind of a shot in the dark, I guess, but have any of you used LeakTracer a lot? Where would you start looking if you got output like the one here? I don't have any string iterators in my program that I'm aware of. What does this mean?

#-- Leak: counted 74x / total Size: 3313520
During symbol reading, struct/union type gets multiply defined: struct __normal_
iterator<char*,std::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> > >.
During symbol reading, struct/union type gets multiply defined: struct __normal_
iterator<const char*,std::basic_string<char, std::char_traits<char>, std::alloca
tor<char> > >.
0x43222d is at /usr/include/c++/3.2/bits/char_traits.h:147.
146           copy(char_type* __s1, const char_type* __s2, size_t __n)
147           {  return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
0
Comment
Question by:loveslave
3 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 250 total points
ID: 9785332
Start with the leaks in your code. This one is comming from STL which is pretty well tested. I guess that you have a class/struct object which is not released and has a string member inside. With deleting your object the string will be released as well. Thus both leaks disappear at the same time.
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10249312
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: SteH {http:#9785332}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question