Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5E5CF650E99 for ; Tue, 24 Jun 2008 12:37:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16426-02 for ; Tue, 24 Jun 2008 12:37:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by postgresql.org (Postfix) with ESMTP id 1F466650E8E for ; Tue, 24 Jun 2008 12:37:38 -0300 (ADT) Received: from [192.168.10.64] (ASte-Genev-Bois-153-1-80-7.w86-203.abo.wanadoo.fr [86.203.226.7]) by sd-2317.dedibox.fr (Postfix) with ESMTP id E1E612635; Tue, 24 Jun 2008 17:37:35 +0200 (CEST) Message-ID: <486114BF.7040901@lelarge.info> Date: Tue, 24 Jun 2008 17:37:35 +0200 From: Guillaume Lelarge User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Tom Lane CC: Marc Cousin , pgsql-admin@postgresql.org Subject: Re: plpgsql function seems to be leaking memory References: <200806241056.29589.mcousin@sigma.fr> <16759.1214319370@sss.pgh.pa.us> In-Reply-To: <16759.1214319370@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/207 X-Sequence-Number: 29545 Tom Lane a écrit : > Marc Cousin writes: >> I'm having a problem with plpgsql functions leaking memory. > > Your example shows absolutely no memory leak here, in either 8.3.3 > or CVS HEAD. > >> I see the postgresql process growing from 8MB to about 400 MB during this >> run... > > What do you have shared_buffers set to? I think you might be getting > fooled by top's treatment of shared memory (ie, it starts to count > shared pages after the process touches them for the first time). > That's what I thought at first when I saw Marc's email. I tried his example many times, with different values for shared_buffers. RSS column climbs until it reaches more or less the shared_buffers configuration. But, if I launch another psql, this process will have a much lower value on the RSS column. Shouldn't it get the RSS at the same value, even when the process starts ? I'm a bit puzzled by this column, anyone has a URL where I can find more info? Regards. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com