Closed seanpringle closed 8 years ago
Thanks for pointing out the problem. I think it is corrected now. Could you, please, check the new version 2.3.2?
Thanks. 2.3.2 fixes the memory leak, but also causes #46.
Sure, my bad. I hope the problem is now corrected.
Thanks, Tomás
On 2016-05-15 21:18, seanpringle wrote:
Thanks. 2.3.2 fixes the memory leak, but also causes #45 [1].
You are receiving this because you commented. Reply to this email directly or view it on GitHub [2]
*
Links:
[1] https://github.com/keplerproject/luasql/issues/45 [2] https://github.com/keplerproject/luasql/issues/45#issuecomment-219323792
Before I go down this rabbit hole, a quick question in case I'm missing something obvious:
Ubuntu 14.04 LTS lua-sql-postgres:amd64 2.3.0-3
Am seeing a memory leak when luasql fails to connect to Postgres. Memory footprint increases steadily for a long-running script with persistent connections that periodically attempts to reconnect to a database that is temporarily offline.
Is it intentional that ls_postgres.c
env_connect()
does not callPQfinish()
whenPQstatus()
returnsCONNECTION_BAD
? At first glance it looks like a failedPGconn
struct will never be seen byconn_gc()
.According to libpq docs [1]
PQfinish()
should be called even when aPQstatus()
returnsCONNECTION_BAD
in order to release any memory allocated by libpq during the connection attempt.[1] http://www.postgresql.org/docs/9.5/static/libpq-connect.html#LIBPQ-PQFINISH