I'd already googled for python memory leaks and read about circular references,
so found that these seem to fix it.  The commented lines were ones that don't
seem necessary to resolve the leak.  I believe you're intended to use a weak
reference for these, but I tried the obvious (naive) thing and failed.

del x.adapter.escape_string
del x.adapter.escape_bytea
#del x.adapter.encode_json
#del x.adapter.db.db
#del x.adapter.db
#del x.adapter

del x.dbtypes.query
del x.dbtypes.escape_string
#del x.dbtypes._get_attnames
#del x.dbtypes._typecasts.get_attnames
#del x.dbtypes._typecasts.connection # circular

#del x.dbtypes

del x._args
#del x.db

_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to