|
From: Julian S. <js...@ac...> - 2005-05-19 23:12:26
|
> It looks like it's not a problem with realloc() directly, but a problem
> with copying between large allocated chunks. This program:
I think Nick's analysis is right. I'm just surprised V will hold onto
700M of stuff. I thought we had it so that it would only hold on to
a fixed amount, by default 1MB of space (--freelist-vol= ..)
So here's a question. How does the following variant behave?
> #include <stdlib.h>
> #include <string.h>
>
> int main(int argc, char **argv)
> {
> int len = 0;
> char *data = NULL;
> int do_copy = 1;
>
> for(int i=0; i<2000; i++) {
> len += 4096;
> char *data = (char *) malloc(len*sizeof(char));
> free(data);
> }
>
> return 0;
> }
J
|