Re: Question about the MemoryContext

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Question about the MemoryContext
Date: 2006-04-22 22:16:13
Message-ID: 9166.1145744173@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gevik Babakhani <pgdev(at)xs4all(dot)nl> writes:
> Could someone please explain the MemoryContext switching. For example
> MemoryContextSwitchTo function. How does this work?

src/backend/utils/mmgr/README might help. It's somewhat pointed at
people who've already been hacking the backend, but I think it will
give you the idea.

The basic point is that palloc() allocates memory in whichever context
was last selected as CurrentMemoryContext by MemoryContextSwitchTo.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gevik Babakhani 2006-04-22 22:43:17 Re: Question about the MemoryContext
Previous Message daveg 2006-04-22 21:20:32 Re: [HACKERS] Automatically setting work_mem