[webkit-dev] Questions regarding memory debugging

Zoltan Herczeg zherczeg at inf.u-szeged.hu
Wed Mar 10 11:48:11 PST 2010

> But in cases like the SharedBuffer one, there is no mystery about who
> allocated the memory. The mystery is typically who is holding on to a
> reference to it.

I have a technique to capture ref/deref problems with gdb. When the object
is created (inside the object constructor), I just put a write break point
to the address of m_refCount: "watch this->m_refCount" in gdb. The
backtrace can be inspected every time when this watch point is hit. Ref /
derefs must be in pairs, usually easy to find which ref has no deref pair.
Gdb also supports executing scripts when a breakpoint is hit, this could
be useful to perform some tasks (see the COMMAND command).


More information about the webkit-dev mailing list