This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Problems with releasing memory for the "vector"!


Hi, guys

I think the best way is to attach a test program, atest.cpp.

I was releasing memory from a nested vector:

vector< vector<someclass> > F;

But never get it done...

My results are:

 RSS   VSZ %MEM CMD
1348  4664  0.0 -bash
2024  8676  0.0 vim atest.cpp
119560 121124  5.7 a.out
 664  2624  0.0 ps -orss,vsize,%mem,cmd
Before clear --------------------------

 RSS   VSZ %MEM CMD
1348  4664  0.0 -bash
2024  8676  0.0 vim atest.cpp
107320 108836  5.1 a.out
 664  2624  0.0 ps -orss,vsize,%mem,cmd
After clear ---------------------------


As you can see, memory was not released even for non-existing variable.

My platform: Xeon 2.4Ghz, Redhat9, kernel 2.4.21, gcc version 3.2.2 20030222 .

Any comments?


Thanks!
Johnix

Attachment: atest.cpp
Description: Binary data


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