Re: Patch for fixing a few memory leaks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Teodor Sigaev <teodor(at)stack(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch for fixing a few memory leaks
Date: 2001-10-04 22:50:34
Message-ID: 2671.1002235834@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Is there some sort of a system behind which places are subject to leaks
> and which places are just too lazy to call pfree()?

> I know that index support procedures must not leak, hmm, I guess this
> would include the function manager...

Yeah, that's basically why there's a problem here --- if this weren't
getting called from the index support area, I don't think the leak would
matter.

> Why aren't index support procedures called with an appropriate memory
> context set up?

I looked at recovering space after index operations but decided it would
take more work than I could invest at the time. The trouble is that
several of the index AMs allocate space that they expect to stick around
across operations, so they'd have to be fixed to use a special context
for such things. Eventually it'd be nice to fix it properly, ie, run
index support routines with CurrentMemoryContext = a short-term context,
just as you say.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Summerfield 2001-10-05 01:40:22 Re: cvs problem
Previous Message Peter Eisentraut 2001-10-04 22:36:26 Re: Patch for fixing a few memory leaks