According to the docs
https://vld.codeplex.com/wikipage?title=Configuration%20Options&referringTitle=Documentation
"AggregateDuplicates ... will make VLD aggregate all leaks that share the same size and call stack"
Even with this option set, I still get a very big logfile (1230 unique call stacks). I would like to have the possibility to enable even more aggressive behaviour to reduce the duplicates. [Of course this behaviour can be controlled by one or more options in vld.ini]
Here are some suggestions how to do it:
1) Don't require same size of allocation to aggregate.
2) Allow fuzzy rather than exact matching of call-stack for "similar" leaks.
Example:
void init() {
leaky("foo");
leaky("bar");
return 0;
}
void leaky(const char * const s) {
strdup(s);
}
In this example the line number for init() will be different between the two call stacks, but everything else is identical (and in fact the cause of the leak is the same).
Ideally we would like ALL calls to leaky(...) aggregated as a single log entry, but in practice it might be hard to do this without sometimes grouping really unique leaks as duplicate. A "fuzziness" parameter is definitely required.
3) Allow fuzzy matching even with macro-written code.
Example:
#define DEF_LEAKY(NAME) \
struct NAME { \
NAME() { strdup(#NAME); } \
};
DEF_LEAKY(Foo)
DEF_LEAKY(Bar)
void init()
{
Foo f;
Bar b;
}
In this example both the function (c'tor) names and line numbers at the top frame of the call stack are different e.g. Foo::Foo() vs Bar::Bar(), but really they are duplicates of the same leak as in 2.
Actually I think 3 is just a special case of 2, but I would like to mention it explicitly as this happens rather often in my real-world code. In this real-world example, the thing which is always identical is the offset, e.g. Foo::Foo + 0x1A bytes / Bar::Bar + 0x1A bytes. It's always 0x1A bytes.
https://vld.codeplex.com/wikipage?title=Configuration%20Options&referringTitle=Documentation
"AggregateDuplicates ... will make VLD aggregate all leaks that share the same size and call stack"
Even with this option set, I still get a very big logfile (1230 unique call stacks). I would like to have the possibility to enable even more aggressive behaviour to reduce the duplicates. [Of course this behaviour can be controlled by one or more options in vld.ini]
Here are some suggestions how to do it:
1) Don't require same size of allocation to aggregate.
2) Allow fuzzy rather than exact matching of call-stack for "similar" leaks.
Example:
void init() {
leaky("foo");
leaky("bar");
return 0;
}
void leaky(const char * const s) {
strdup(s);
}
In this example the line number for init() will be different between the two call stacks, but everything else is identical (and in fact the cause of the leak is the same).
Ideally we would like ALL calls to leaky(...) aggregated as a single log entry, but in practice it might be hard to do this without sometimes grouping really unique leaks as duplicate. A "fuzziness" parameter is definitely required.
3) Allow fuzzy matching even with macro-written code.
Example:
#define DEF_LEAKY(NAME) \
struct NAME { \
NAME() { strdup(#NAME); } \
};
DEF_LEAKY(Foo)
DEF_LEAKY(Bar)
void init()
{
Foo f;
Bar b;
}
In this example both the function (c'tor) names and line numbers at the top frame of the call stack are different e.g. Foo::Foo() vs Bar::Bar(), but really they are duplicates of the same leak as in 2.
Actually I think 3 is just a special case of 2, but I would like to mention it explicitly as this happens rather often in my real-world code. In this real-world example, the thing which is always identical is the offset, e.g. Foo::Foo + 0x1A bytes / Bar::Bar + 0x1A bytes. It's always 0x1A bytes.