pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Curing plpgsql's memory leaks for statement-lifespan values
Date: Fri, 19 Aug 2016 12:29:09 -0500
Message-ID: <d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com> (raw)
In-Reply-To: <18951.1471621364@sss.pgh.pa.us>
References: <17863.1469142152@sss.pgh.pa.us>
	<CAA4eK1JRdXqfaA25vJkVcjoi0h5YzH9Mi1brTO2DgDO6SVE26g@mail.gmail.com>
	<5811.1469375275@sss.pgh.pa.us>
	<CAA4eK1+fYBqD=+0=iEayVJ=PwQOJ+wxFHChB-AOs=d5tSDAkhw@mail.gmail.com>
	<5916.1469472648@sss.pgh.pa.us>
	<d469bd35-35c8-f68a-540f-c542ce601a54@BlueTreble.com>
	<18951.1471621364@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (20+ messages)

Message-ID: <d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com>
Permalink:  ../d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com/
Also on:    postgresql.org/message-id/d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: Jim.Nasby@BlueTreble.com, tgl@sss.pgh.pa.us, amit.kapila16@gmail.com
  Subject: Re: Curing plpgsql's memory leaks for statement-lifespan values
  In-Reply-To: <d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com>
  References: <17863.1469142152@sss.pgh.pa.us> <CAA4eK1JRdXqfaA25vJkVcjoi0h5YzH9Mi1brTO2DgDO6SVE26g@mail.gmail.com> <5811.1469375275@sss.pgh.pa.us> <CAA4eK1+fYBqD=+0=iEayVJ=PwQOJ+wxFHChB-AOs=d5tSDAkhw@mail.gmail.com> <5916.1469472648@sss.pgh.pa.us> <d469bd35-35c8-f68a-540f-c542ce601a54@BlueTreble.com> <18951.1471621364@sss.pgh.pa.us> <d7f3cc7b-ca8f-f9ab-edd9-a93195c6ce2a@BlueTreble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox