BUG #4510: memory leak with libpg.dll

Started by MWendtover 17 years ago3 messagesbugs
Jump to latest
#1MWendt
marian.wendt@inca.eu

The following bug has been logged online:

Bug reference: 4510
Logged by: MWendt
Email address: marian.wendt@inca.eu
PostgreSQL version: 8.1.x, 8.2.x
Operating system: windows xp (client), linux (postgres server)
Description: memory leak with libpg.dll
Details:

1) DB server is down.
2) the client will connect to these DB server and is running correctly in a
timeout. the problem is: for each connection attempt that will fail the
memory usage is growing. that will result in massive memory allocation, if
the client try to reconnect in high frequency. and furthermore the memory is
not freed when the next connection can be established.
3) I guess in libpg.dll are some connection structures that are not freed
correctly if the connection coult not established well.

#2Craig Ringer
craig@2ndquadrant.com
In reply to: MWendt (#1)
Re: BUG #4510: memory leak with libpg.dll

MWendt wrote:

The following bug has been logged online:

Bug reference: 4510
Logged by: MWendt
Email address: marian.wendt@inca.eu
PostgreSQL version: 8.1.x, 8.2.x
Operating system: windows xp (client), linux (postgres server)
Description: memory leak with libpg.dll
Details:

1) DB server is down.
2) the client will connect to these DB server and is running correctly in a
timeout. the problem is: for each connection attempt that will fail the
memory usage is growing. that will result in massive memory allocation, if
the client try to reconnect in high frequency. and furthermore the memory is
not freed when the next connection can be established.
3) I guess in libpg.dll are some connection structures that are not freed
correctly if the connection coult not established well.

Is there any chance you can supply the source code of a self-contained,
compileable test case (example program) that can demonstrate this? Your
description doesn't exclude the possibility of leaks occurring as a
consequence of failure to free resources in the program using libpq.

--
Craig Ringer

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Craig Ringer (#2)
Re: BUG #4510: memory leak with libpg.dll

Craig Ringer <craig@postnewspapers.com.au> writes:

MWendt wrote:

2) the client will connect to these DB server and is running correctly in a
timeout. the problem is: for each connection attempt that will fail the
memory usage is growing. that will result in massive memory allocation, if
the client try to reconnect in high frequency.

Is there any chance you can supply the source code of a self-contained,
compileable test case (example program) that can demonstrate this? Your
description doesn't exclude the possibility of leaks occurring as a
consequence of failure to free resources in the program using libpq.

In particular I wonder whether the application is neglecting to call
PQfinish() on the failed connection objects ...

regards, tom lane