Re: shall we have a TRACE_MEMORY mode - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: shall we have a TRACE_MEMORY mode
Date
Msg-id 20060620031810.GB26882@surnet.cl
Whole thread Raw
In response to shall we have a TRACE_MEMORY mode  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Responses Re: shall we have a TRACE_MEMORY mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: shall we have a TRACE_MEMORY mode  (korry <korry@appx.com>)
List pgsql-hackers
Qingqing Zhou wrote:
> As I follow Relyea Mike's recent post of possible memory leak, I think that
> we are lack of a good way of identifing memory usage. Maybe we should also
> remember __FILE__, __LINE__ etc for better memory usage diagnose when
> TRACE_MEMORY is on?

Hmm, this would have been a great help to me not long ago, so I'd say it
would be nice to have.

About the exact form we'd give the feature: maybe write each
allocation/freeing to a per-backend file, say /tmp/pgmem.<pid>.  Also
memory context creation, destruction, reset.  Having the __FILE__ and
__LINE__ on each operation would be a good tracing tool as well.  Then
it's easy to write Perl tools to find specific problems.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: checking on buildfarm member thrush
Next
From: Tom Lane
Date:
Subject: Re: shall we have a TRACE_MEMORY mode