http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #6 from Antoine Poliakov 2012-04-30
15:31:17 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > You should probably use sbrk and/or experiment with
>
> Sorry, I meant use strace, *not* sbrk!
malloc_trim(0) saved the day
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #5 from Antoine Poliakov 2012-04-30
15:27:16 UTC ---
(In reply to comment #2)
> So it's possible to get the memory libstdc+ allocates to be returned to the
> system, but it's under the control of glibc, nothing to do with std::vector
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #4 from Jonathan Wakely 2012-04-30
15:16:14 UTC ---
(In reply to comment #3)
> You should probably use sbrk and/or experiment with
Sorry, I meant use strace, *not* sbrk!
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #3 from Jonathan Wakely 2012-04-30
15:13:07 UTC ---
Similarly, calling malloc_trim(0) after test() causes glibc to immediately
return the memory to the system (requiring a sbrk system call next time memory
is needed)
You should proba
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #2 from Jonathan Wakely 2012-04-30
14:59:05 UTC ---
By changing your main to:
int main() {
test();
sleep(10);
char* p = (char*)malloc(1024 * 127);
for (int i=0; i < 100; ++i)
p[1024 * i] = 'a' + (i
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53169
--- Comment #1 from Jonathan Wakely 2012-04-30
14:28:11 UTC ---
(In reply to comment #0)
> The attached source is a minimal test case, implementing a sparse array of
> std::vectors in class Collection, and test() demonstrates its use in a memory