Re: memory leak in date_part() function in v7.1beta3 ? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: memory leak in date_part() function in v7.1beta3 ?
Date
Msg-id 11277.980729237@sss.pgh.pa.us
Whole thread Raw
In response to memory leak in date_part() function in v7.1beta3 ?  (doj <doj@cubic.org>)
List pgsql-bugs
doj <doj@cubic.org> writes:
> I was experimenting with the 7.1beta3 release. When I use the
> date_part() function in one query several thousand times (in updates for
> example) the postmaster consumes all available memory, until it dies,
> with a "no memory left error". If I execute the same queries without
> date_part() functions everything runs smooth.

It turns out this is not specific to date_part(date); in fact, *all*
SQL-language functions were leaking memory.  I have fixed the leaks
exposed by this example and some related ones, but I suspect that
some complex queries inside SQL functions will still leak a small
amount of memory per execution.  We really need to reconsider how
per-query data structures are allocated ... perhaps as part of the
long-threatened querytree redesign.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: memory leak in date_part() function in v7.1beta3 ?
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Cannot drop and recreate "primary key" index