Re: Memory management question - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Memory management question
Date
Msg-id 3D74FBEA.40105@joeconway.com
Whole thread Raw
In response to Memory management question  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List pgsql-hackers
Nigel J. Andrews wrote:
> 
> It's probably a pretty basic question explained in some document I haven't seen
> but...if I do something like a CreateTupleDescCopy() how do I know my memory
> context owns everything allocated without following the code all the way
> through until it returns to me?

I asked a related question recently. Here it is with Tom's response:

Tom Lane wrote:> Joe Conway wrote:>>Does a good primer on proper backend memory-context handling exist?>> The original
designdocument is in src/backend/utils/mmgr/README;> somebody needs to recast that into present tense and put it into
the>Developer's Guide SGML docs.>> If you read that and feel you understand it, next read> executor/nodeAgg.c and see
ifyou follow the memory management> there...> AFAIR that's the most complex use of short-term contexts in the> system.
 

You might want to read through those to get a better understanding.

HTH,

Joe



pgsql-hackers by date:

Previous
From: Barry Lind
Date:
Subject: Re: possible vacuum improvement?
Next
From: Peter Eisentraut
Date:
Subject: Re: CREATE CAST requires immutable cast function?