OSDN Git Service

Theses buffer leaks are caused by indexes that are kept open between
authorBruce Momjian <bruce@momjian.us>
Tue, 21 Jul 1998 04:17:30 +0000 (04:17 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 21 Jul 1998 04:17:30 +0000 (04:17 +0000)
commite0058b61728438469898845be0a7afb73f2ebc86
tree0345a599406f6476478094ddfaf096c0df6a348a
parent7702d7aa4b7ac61cad6538ce62de395cd04dfbe9
Theses buffer leaks are caused by indexes that are kept open between
calls. Outside a transaction, the backend detects them as buffer
leaks; it sends a NOTICE, and frees them. This sometimes cause a
segmentation fault (at least on Linux). These indexes are initialized
on the first lo_read/lo_write/lo_tell call, and (normally) closed
on a lo_close call.  Thus the buffer leaks appear when lo direct
access functions are used, and not with lo_import/lo_export functions
(libpq version calls lo_close before ending the command, and the
backend version uses another path).

The included patches (against recent snapshot, and against 6.3.2)
cause indexes to be closed on transaction end (that is on explicit
'END' statment, or on command termination outside trasaction blocks),
thus preventing the buffer leaks while increasing performance inside
transactions. Some (all?) 'classic' memory leaks are also removed.

I hope it will be ok.

--- Pascal ANDRE, graduated from Ecole Centrale Paris andre@via.ecp.fr
src/backend/access/transam/xact.c
src/backend/libpq/be-fsstubs.c
src/backend/storage/large_object/inv_api.c
src/include/libpq/be-fsstubs.h
src/include/storage/large_object.h