pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In libpq, free any partial query result before collecting a serv
6+ messages / 1 participants
[nested] [flat]

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d25c2ee9c038969eca8080177738dddf97a2cade

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d014b38df60fe7f486bfaeb9b55a4851bf32c86f

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2278e94ae9410716209487ad929d2eae24da0b47

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/131f6a9583600cc108891ff638e94633336d9f17

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bbec33c2d0263e367f7ba7d7add768d16861d8a7

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In libpq, free any partial query result before collecting a serv
@ 2018-04-13 16:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-13 16:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In libpq, free any partial query result before collecting a server error.

We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3dd36aa4b36c97cf9e00d29d8b138a1f1990fc62

Modified Files
--------------
src/interfaces/libpq/fe-protocol2.c | 10 +++++++++-
src/interfaces/libpq/fe-protocol3.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-04-13 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>
2018-04-13 16:54 pgsql: In libpq, free any partial query result before collecting a serv Tom Lane <tgl@sss.pgh.pa.us>

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