Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A2FCB1E9AFB1 for ; Mon, 12 Dec 2011 07:33:21 -0400 (AST) Received: from exprod7og105.obsmtp.com ([64.18.2.163]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ra48H-0000vr-0y for pgsql-bugs@postgresql.org; Mon, 12 Dec 2011 11:33:22 +0000 Received: from mail-ey0-f169.google.com ([209.85.215.169]) (using TLSv1) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKTuXmcywbpSAkjA4Clymb90yGD+sRXcCq@postini.com; Mon, 12 Dec 2011 03:33:20 PST Received: by eaai13 with SMTP id i13so867425eaa.0 for ; Mon, 12 Dec 2011 03:33:06 -0800 (PST) Received: by 10.213.27.212 with SMTP id j20mr3550314ebc.21.1323689585918; Mon, 12 Dec 2011 03:33:05 -0800 (PST) Received: from [192.168.1.101] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id z43sm61973544eef.7.2011.12.12.03.33.04 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 03:33:05 -0800 (PST) Message-ID: <4EE5E66F.5080508@enterprisedb.com> Date: Mon, 12 Dec 2011 13:33:03 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 MIME-Version: 1.0 To: Matteo Beccati CC: pgsql-bugs@postgresql.org Subject: Re: Postgresql 9.1.2 - abnormal memory usage References: <396904450.20111211221529@erwied.eu> <201112120045.23211.andres@anarazel.de> <201112120145.42463.andres@anarazel.de> <27575.1323671190@sss.pgh.pa.us> <4EE5BB70.4090903@enterprisedb.com> <4EE5E273.8040201@beccati.com> In-Reply-To: <4EE5E273.8040201@beccati.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201112/79 X-Sequence-Number: 31890 On 12.12.2011 13:16, Matteo Beccati wrote: > On 12/12/2011 09:29, Heikki Linnakangas wrote: >> On 12.12.2011 08:26, Tom Lane wrote: >>> Andres Freund writes: >>>> In 3b8161723c645853021b57330dd2ea0484ec6131 Heikki made DatumGetInetP >>>> unpack >>>> toasted values. Unfortunately the btree support functions for the >>>> inet type >>>> didn't free memory which they have to do in contrast to about >>>> everything else. >>> >>>> I fixed a few more functions than strictly necessary but I guess >>>> thats ok. >>> >>> Seems like the correct fix is to revert these functions to the former >>> behavior, ie they should be using the PP macros not the unpacking ones. >> >> Agreed, there's no need to unpack here. Fixed, thanks for the report! > > Just to clarify, am I correct assuming that the issue does not affect > tables which have non-indexed inet fields? Hmm, I think it might also affect queries that do large merge joins on inet fields. Not sure about that. In any case, it's a memory leak that gets cleared at the end of statement, so it can only become a problem when dealing with large data sets. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com