Re: memory leak checking

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mikhail Bautin <mbautinpgsql(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: memory leak checking
Date: 2019-04-23 01:30:05
Message-ID: 20190423013005.puy7eik35ah2clp3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-04-22 20:29:17 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2019-04-22 16:50:25 -0700, Mikhail Bautin wrote:
> >> What is the standard memory leak checking policy for the PostgreSQL
> >> codebase? I know there is some support for valgrind -- is the test suite
> >> being run continuously with valgrind on the build farm?
>
> > Leaks are allowed if they are once-per-backend type things. There's no
> > point in e.g. freeing information for timezone metadata, given that
> > it'll be used for the whole server lifetime. And there's such things in
> > psql too, IIRC.
>
> I would not call the timezone data a "leak", since it's still useful, and
> accessible from static pointers, right up to exit. A true leak for this
> purpose is memory that's allocated but not usefully accessible, and I'd
> say we discourage that; though small one-time leaks may not be worth the
> trouble to get rid of.

Right. I was only referring to it that way because the various leak
checking tools do, should've been more careful in wording...

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-23 01:38:22 Re: memory leak checking
Previous Message Bruce Momjian 2019-04-23 01:18:52 Re: finding changed blocks using WAL scanning