Re: Probable memory leak with ECPG and AIX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Benoit Lobréau <benoit(dot)lobreau(at)gmail(dot)com>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, "Dr(dot) Michael Meskes" <michael(dot)meskes(at)credativ(dot)com>
Subject: Re: Probable memory leak with ECPG and AIX
Date: 2022-01-01 16:35:02
Message-ID: 2865639.1641054902@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> writes:
> I get the same results. The leak arises because AIX freelocale() doesn't free
> all memory allocated in newlocale(). The following program uses trivial
> memory on GNU/Linux, but it leaks like you're seeing on AIX:

Bleah.

> If you have access to file an AIX bug, I recommend doing so. If we want
> PostgreSQL to work around this, one idea is to have ECPG do this newlocale()
> less often. For example, do it once per process or once per connection
> instead of once per ecpg_do_prologue().

It's worse than that: see also ECPGget_desc(). Seems like a case
could be made for doing something about this just on the basis
of cycles expended, never mind freelocale() bugs.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-01-01 17:21:06 Re: using extended statistics to improve join estimates
Previous Message Zhihong Yu 2022-01-01 15:33:10 Re: Collecting statistics about contents of JSONB columns