|
From: Eyal L. <ey...@ey...> - 2004-01-16 07:51:27
|
Julian Seward wrote: > > 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] Used '--freelist-vol=0' - no change. Furthermore, since I know the failure is in a malloc that never returns, I put a sleep(2) just before the malloc and started a 'vmstat 1'. It fails in the same way and only under 400MB of swap (out of 2GB) is used max. Is there any other tracing I can turn on to help diagnose the problem? -- Eyal Lebedinsky (ey...@ey...) <http://samba.org/eyal/> |