|
From: Julian S. <js...@ac...> - 2004-01-15 18:40:33
|
On Thursday 15 January 2004 08:57, Robert Walsh wrote:
> > However, the same sort of malloc() followed by a free() was
> > done a number of times earlier. If vg holds on to freed
> > memory then there may be a problem. The machine is 1GB memory
> > and 2GB swap and abour 450MB of swap was used at the time
> > of failure.
>
> Valgrind does hold on to memory for a certain length of time after it's
> been freed. This is to catch things like this:
>
> x = malloc(10);
> free(x);
> y = malloc(10);
> *x = 0;
>
> If the second malloc happed to return the same value as the first, the
> invalid write to *x would never be caught.
>
> However, it doesn't keep these forever, and I had assumed it would use
> that pool when it ran out of memory. Hmm. Too tired to look at the
> code now, but it's in there somewhere. Search for freed_list.
Command-line parameter:
--freelist-vol=<number> volume of freed blocks queue [1000000]
Eyal, try with ...=0
J
|