Polyakov Vladimir <vvpolyakov@xxxxxxxxx> writes: > Program written in C using Libpq, which receives large files (BYTEA) > has a memory leak. > I need to free ALL of the used memory after each sql query. > after each call PQclear() I drop the buffer: > conn->inBuffer = realloc(conn->inBuffer, 8192); > conn->inBufSize = 8192; When you break it, you get to keep both pieces. Whatever gave you the idea that the above would be considered a supported thing to do? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general