Neil Conway <neilc@samurai.com> writes:
> - abandonded the falloc() idea. There really aren't that many
> short-lived allocations in the PL/PgSQL compiler, and using falloc()
> made it difficult to use List. Instead, make the CurrentMemoryContext
> the long-lived function context, and explicitly pfree short-term
> allocations. Not _all_ short-lived allocations are explicitly released;
> if this turns out to be a problem, it can be cleaned up later.
My recollection is that I was not nearly as worried about short-term
pallocs in the plpgsql code itself, as about leakage in various main-
backend routines that get called incidentally during parsing.
backend/parser/ is quite cavalier about this as a whole, because it
expects to be called in contexts that are not long-lived. Have you
done any checking to ensure that the per-function context doesn't get
unreasonably bloated this way?
regards, tom lane