Re: shall we have a TRACE_MEMORY mode

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <alvherre(at)commandprompt(dot)com>
Cc: <simon(at)2ndquadrant(dot)com>, <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <zhouqq(at)cs(dot)toronto(dot)edu>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: shall we have a TRACE_MEMORY mode
Date: 2006-06-20 11:50:26
Message-ID: 1354.24.211.165.134.1150804226.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera said:

>
>> That seems mostly the hard way to me, because our memory management
>> scheme is *not* based around "thou shalt free() what thou malloc()ed".
>> You'd need a tool that understood about resetting memory contexts
>> (recursively) to get anywhere at all in analyzing such a trace.
>
> Of course. It's not difficult to do that; just tedious. I wrote such
> a tool to debug a Mammoth Replicator problem (I don't think I've kept
> it though). The logging code must emit messages about context
> creation, destruction and reset, and have the alloc message indicate
> what context is the chunk being created on.
>

Could we tag each context with its name? Then we could centralise a lot of
this, ISTM, and the overhead involved in setting the tag at context creation
doesn't seem like a heavy price to pay.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-06-20 12:02:34 Re: shall we have a TRACE_MEMORY mode
Previous Message Dave Page 2006-06-20 11:27:00 Re: CVS HEAD busted on Windows?