pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Anderson Valadares <andervalbh@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6785: Memory Leak in plpgsql
Date: Mon, 30 Jul 2012 17:56:22 +0200
Message-ID: <201207301756.22678.andres@2ndquadrant.com> (raw)
In-Reply-To: <CALaY=XmA88AN3T+Zc4szVTRotz-DO8bVgHe4-66So3=dbzdb1w@mail.gmail.com>
References: <E1Svpov-0005ND-Jf@wrigleys.postgresql.org>
	<201207301706.13963.andres@2ndquadrant.com>
	<CALaY=XmA88AN3T+Zc4szVTRotz-DO8bVgHe4-66So3=dbzdb1w@mail.gmail.com>

Hi,

On Monday, July 30, 2012 05:38:07 PM Anderson Valadares wrote:
> I understand, but the memory should not be returned after the execution of
> the function?
Well, that depends on how memory was allocated by the libc. When it used brk() 
to allocate memory its rather likely that the memory cannot directly be 
returned because some block of memory in the new memory is still used by some 
permanent memory context.

> Below is the result of running with more than 55,000 calls.
> 
> PID USER      PR  NI  VIRT SWAP  RES CODE DATA  SHR S P %CPU %MEM    TIME+
>  COMMAND
> 618 postgres  15   0 1687m 1.2g 507m 4684 505m 3796 S 1  0.0  4.2   0:04.90
> postgres: postgres test [local] idle
Interesting. I just let the thing run - by accident - for 30+ minutes and it 
still hovered at 96MB.

Greetings,

Andres
-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



view thread (5+ messages)  latest in thread

Message-ID: <201207301756.22678.andres@2ndquadrant.com>
Permalink:  ../201207301756.22678.andres@2ndquadrant.com/
Also on:    postgresql.org/message-id/201207301756.22678.andres@2ndquadrant.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-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, andervalbh@gmail.com
  Subject: Re: BUG #6785: Memory Leak in plpgsql
  In-Reply-To: <201207301756.22678.andres@2ndquadrant.com>
  References: <E1Svpov-0005ND-Jf@wrigleys.postgresql.org> <201207301706.13963.andres@2ndquadrant.com> <CALaY=XmA88AN3T+Zc4szVTRotz-DO8bVgHe4-66So3=dbzdb1w@mail.gmail.com> <201207301756.22678.andres@2ndquadrant.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