Re: Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table
Date: 2013-06-18 12:48:44
Message-ID: 51C0572C.5080708@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.06.2013 14:27, MauMau wrote:
> The cause of the memory increase appears to be CacheMemoryContext. When
> I attached to postgres with gdb and ran "call
> MemoryContextStats(TopMemoryContext)" several times, the size of
> CacheMemoryContext kept increasing.

Hmm. I could repeat this, and it seems that the catcache for
pg_statistic accumulates negative cache entries. Those slowly take up
the memory.

Seems that we should somehow flush those, when the table is dropped. Not
sure how, but I'll take a look.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-06-18 12:54:52 Re: Support for REINDEX CONCURRENTLY
Previous Message Etsuro Fujita 2013-06-18 12:15:27 Re: Patch for removng unused targets