This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: STL-String memory leak?


Gero Krueger <krueger@obk.telekom.de> writes:

| Hello developers !
| 
| I've got some memory-problems using stl-strings.
| I'm running RH6.1 kernel 2.2.12 with g++ 2.95.1.
| 
| Please take a look at the following short piece of code:

[...]

| The programm should clear all memory allocated by
| the "new" statement.

"should clear" is strong a requirement.

| When I watch it with "ps axu" and take a look at its memory 
| consumption - no memory is freed.
| 
| My questions are: 
| 
| Can I really measure the memory consumption with ps ?

I don't think ps is accurate enough for measuring memory consumption
in a given program. 

| Did I make a basic mistake ?

I think the right question would be: when does 'free()' free memory?
But I bet the answer is completely orthogonal to the issue of possible
memory leakage in v-3's implementation of std::string.


-- Gaby

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]