From: Bruce Momjian Date: Sun, 23 Jun 2002 21:29:32 +0000 (+0000) Subject: It seems that ExecInit/EndIndexScan is leaking some memory... X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=00c33f68663781145619c16f90ab21db011133bf;p=users%2Fbernd%2Fpostgres.git It seems that ExecInit/EndIndexScan is leaking some memory... For example, if I run a query, that uses an index scan, and call MemoryContextSt ats (CurrentMemoryContext) before ExecutorStart() and after ExecutorEnd() in ProcessQuery(), I am consistently see ing that the 'after' call shows 256 bytes more used, then 'before'... The problem seems to be in ExecEndIndexScan - it does not release scanstate, ind exstate, indexstate->iss_RelationDescs and indexstate -> iss_ScanDescs... Dmitry Tkach --- diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 71fbceee8a..53352de5c8 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -516,6 +516,10 @@ ExecEndIndexScan(IndexScan *node) */ ExecClearTuple(scanstate->cstate.cs_ResultTupleSlot); ExecClearTuple(scanstate->css_ScanTupleSlot); + pfree(scanstate); + pfree(indexstate->iss_RelationDescs); + pfree(indexstate->iss_ScanDescs); + pfree(indexstate); } /* ----------------------------------------------------------------