|
From: Jeremy F. <je...@go...> - 2005-02-24 00:38:08
|
I've been using the leak checker a bit lately, and it seems to have a
number of problems:
* It under-reports lost memory, by only pointing out completely
undereferenced allocations. This means that apparently small
leaks are actually large, if they refer to a lot of other memory.
* It completely fails to report leaked cycles. We have software
which uses refcounting, which also loses cycles; we were hoping
that Valgrind would point out deficiencies in the refcount management.
* It doesn't trace from registers, so it can report blocks as leaked
even if there's a register reference (not common, I admit).
To fix all this, I changed the leak checker to use a standard mark-sweep
algorithm. It does a pass from the root set to find unleaked memory,
and then makes a pass over the leaked memory to group it into cliques
(connected graph of allocations); each clique is reported as a leak,
rather than each individual allocation.
I'm still running it through its paces, but it seems to be a big
improvement over the existing checker.
What do people think?
J
|