Solved

Tracing memory leaks (using LeakTracer)

Posted on 2003-11-19
3
344 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now