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

2014-01-26 Thread Heikki Linnakangas
On 01/25/2014 11:36 PM, Bruce Momjian wrote: On Tue, Jun 18, 2013 at 09:07:59PM +0300, Heikki Linnakangas wrote: Hmm. I could repeat this, and it seems that the catcache for pg_statistic accumulates negative cache entries. Those slowly take up the memory. Digging a bit deeper, this is a

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

2014-01-25 Thread Bruce Momjian
On Tue, Jun 18, 2013 at 09:07:59PM +0300, Heikki Linnakangas wrote: Hmm. I could repeat this, and it seems that the catcache for pg_statistic accumulates negative cache entries. Those slowly take up the memory. Digging a bit deeper, this is a rather common problem with negative catcache

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

2013-06-19 Thread MauMau
From: Jeff Janes jeff.ja...@gmail.com On Tue, Jun 18, 2013 at 3:40 PM, MauMau maumau...@gmail.com wrote: Really? Would the catcache be polluted with entries for nonexistent tables? I'm surprised at this. I don't think it is necessary to speed up the query that fails with nonexistent tables,

[HACKERS] Memory leak in PL/pgSQL function which CREATE/SELECT/DROP a temporary table

2013-06-18 Thread MauMau
Hello, I've encountered a memory leak problem when I use a PL/pgsql function which creates and drops a temporary table. I couldn't find any similar problem in the mailing list. I'd like to ask you whether this is a PostgreSQL's bug. Maybe I should post this to pgsql-bugs or pgsql-general,

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

2013-06-18 Thread Heikki Linnakangas
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

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

2013-06-18 Thread Heikki Linnakangas
On 18.06.2013 15:48, Heikki Linnakangas wrote: 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

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

2013-06-18 Thread MauMau
From: Heikki Linnakangas hlinnakan...@vmware.com On 18.06.2013 15:48, Heikki Linnakangas wrote: Hmm. I could repeat this, and it seems that the catcache for pg_statistic accumulates negative cache entries. Those slowly take up the memory. Digging a bit deeper, this is a rather common problem

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

2013-06-18 Thread Jeff Janes
On Tue, Jun 18, 2013 at 3:40 PM, MauMau maumau...@gmail.com wrote: From: Heikki Linnakangas hlinnakan...@vmware.com On 18.06.2013 15:48, Heikki Linnakangas wrote: Hmm. I could repeat this, and it seems that the catcache for pg_statistic accumulates negative cache entries. Those slowly take