Re: Patch for fixing a few memory leaks - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Patch for fixing a few memory leaks
Date
Msg-id Pine.LNX.4.30.0110042246070.877-100000@peter.localdomain
Whole thread Raw
In response to Re: Patch for fixing a few memory leaks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Patch for fixing a few memory leaks
List pgsql-hackers
Tom Lane writes:

> Applied, thanks.  (Looks like the leaks were introduced fairly
> recently by the dynamic-search-path feature.)

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...

(If that was not the right explanation, stop reading here.)

Why aren't index support procedures called with an appropriate memory
context set up?  Since the functions currently do all the cleaning
themselves, couldn't it work like this:

1. set up memory context
2. call index procedure
3. clean out memory context

(This could even be slightly more efficient.)

Then again, I'm probably oversimplifying things...

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Plpython bug with int8 - Found, need advice
Next
From: Tom Lane
Date:
Subject: Re: Patch for fixing a few memory leaks