|
From: Julian S. <js...@ac...> - 2005-05-23 19:33:07
|
Nick wrote: > I think the problem is this: the program allocates a 4KB block, then > frees it. Valgrind puts this block on its free list. The program then > allocates an 8KB block. There's no block on the free list which is 8KB > or > greater, so Valgrind allocates new memory. And so on. So Valgrind's > free > list ends up holding blocks of size 4KB, 8KB, 12KB, 16KB, etc. Huge > amounts of memory quickly get heldon the free list, [...] When you say "free list", do you mean the place where mem/addrcheck park freed stuff for a while so as to delay its re-entry into circulation? If yes, I'm not sure this analysis is right (or else V is buggy :-) There is a limit to the amount of stuff allowed on the free list at once; by default it is 1MB I think. Certainly it shouldn't spiral up into the hundreds of MB. When a free would cause the volume to go above the limit, the oldest stuff is pushed off the end of the free list and potentially back into circulation. J |