pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: wliang@stu.xidian.edu.cn, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Cc: david.g.johnston@gmail.com
Subject: Re: Re all: Report some potential memory leak bugs in pg_dump.c
Date: Sat, 19 Feb 2022 11:49:48 -0500
Message-ID: <59834.1645289388@sss.pgh.pa.us> (raw)
In-Reply-To: <20220219111005.57bfn4qshuqxzkzi@jrouhaud>
References: <1f102fb7.f70.17f1102ec92.Coremail.wliang@stu.xidian.edu.cn>
	<20220219111005.57bfn4qshuqxzkzi@jrouhaud>

Julien Rouhaud <rjuju123@gmail.com> writes:
> Here the amount of leaked memory is likely to be very small (I never heard of
> people having thousands of text search templates or parsers), and pg_dump isn't
> a long lived process so probably no one thought it was worth to extra code to
> free that memory, which I agree with.

Yeah.  For context,

$ valgrind pg_dump regression >/dev/null

reports

==59330== HEAP SUMMARY:
==59330==     in use at exit: 3,909,248 bytes in 70,831 blocks
==59330==   total heap usage: 546,364 allocs, 475,533 frees, 34,377,280 bytes allocated
==59330== 
==59330== LEAK SUMMARY:
==59330==    definitely lost: 6 bytes in 6 blocks
==59330==    indirectly lost: 0 bytes in 0 blocks
==59330==      possibly lost: 0 bytes in 0 blocks
==59330==    still reachable: 3,909,242 bytes in 70,825 blocks
==59330==         suppressed: 0 bytes in 0 blocks

So as long as you're willing to take the regression database as
typical, pg_dump does not have any interesting leak problem.

There are certainly things that this simple test doesn't reach
--- publications/subscriptions are another area besides custom
text search configurations --- but it seems unlikely that a
database would have enough of any of those to justify much worry
about whether those code paths leak anything.

			regards, tom lane





view thread (4+ messages)

Message-ID: <59834.1645289388@sss.pgh.pa.us>
Permalink:  ../59834.1645289388@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/59834.1645289388@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rjuju123@gmail.com, pgsql-bugs@lists.postgresql.org, david.g.johnston@gmail.com
  Subject: Re: Re all: Report some potential memory leak bugs in pg_dump.c
  In-Reply-To: <59834.1645289388@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox