Re: Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table
Date
Msg-id 51C0572C.5080708@vmware.com
Whole thread Raw
In response to Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table  ("MauMau" <maumau307@gmail.com>)
Responses Re: Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table
List 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



pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Re: Patch for removng unused targets
Next
From: Andres Freund
Date:
Subject: Re: Support for REINDEX CONCURRENTLY