This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GDB STL Memory Usage Issue


Hi,

I observed some strange behavior with the following system that I
would like to know more about:

I'm compiling a very memory intensive C++ application that uses STL
(hashmaps of lists). Every few seconds I erase() the entire hashmap
(and the lists). When I run the program standalone and examine the
memory usage using top, I see the total virtual memory of the program
grow (sometimes to 60+MB) before the erase call and after the erase
call drop down to a few MB - which is the behavior I would expect.

However, when I run the same program through GDB, the erase() does not
seem to have any effect and the virtual memory usage keeps on rising -
which I do not understand.

I am using GCC 4.0.3, GDB 6.4 and am compiling the program with
debugging information. I would like to understand the reasons for such
a behavior of my program under GDB.

Thanks in advance,
--
Ravi Ramaseshan
http://www.geocities.com/ramaseshan_ravi/

" Reality is only something we believe in strongly. "


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