Re: Which MemoryContext?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>
Cc: "'Heikki Linnakangas'" <heikki(at)enterprisedb(dot)com>, "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Which MemoryContext?
Date: 2008-02-21 04:04:55
Message-ID: 20080221040455.GD2510@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gevik Babakhani wrote:
> > On backend exit, everything in TopMemoryContext, like all
> > other non-shared memory, is automatically released.
>
> So it is safe to not free the allocated memory in TopMemoryContext and leave
> it to be released on backend exit.

All local memory is safe to handle that way. The problem only arises
when you have memory to release _earlier_ than that.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2008-02-21 04:07:37 Re: Permanent settings
Previous Message Aidan Van Dyk 2008-02-21 04:02:34 Re: Permanent settings