Re: Curing plpgsql's memory leaks for statement-lifespan values - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Curing plpgsql's memory leaks for statement-lifespan values
Date
Msg-id d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com
Whole thread Raw
In response to Re: Curing plpgsql's memory leaks for statement-lifespan values  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 8/19/16 10:42 AM, Tom Lane wrote:
> It appeared to me after collecting some stats about the functions present
> in the regression tests that for larger functions, the extra space eaten
> is just some small multiple (like 2x-3x) of the function body string
> length.  So it's not *that* much data, even for big functions, and it's
> only going to be eaten on the first usage of a function within a session.

I wonder if freeing that memory would help speed up further allocations, 
and how much of the expense of the final free for the context gets 
reduced by an early reset. Probably not enough to negate the cost of 
resetting on every call though...
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: anyelement -> anyrange
Next
From: Tatsuo Ishii
Date:
Subject: Re: Exporting more function in libpq