Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E89AB3C1FBC for ; Sun, 11 Dec 2011 19:45:40 -0400 (AST) Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RZt5Q-0006Pl-Io for pgsql-bugs@postgresql.org; Sun, 11 Dec 2011 23:45:41 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 3A555448008; Mon, 12 Dec 2011 00:45:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 Received: from andres.at.anarazel.de.authenticated.anarazel.de by mail.anarazel.de (Postfix) with ESMTPSA id 44CE7448007 for ; Mon, 12 Dec 2011 00:45:24 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 73C0E1C004D; Mon, 12 Dec 2011 00:45:23 +0100 (CET) From: Andres Freund To: pgsql-bugs@postgresql.org Subject: Re: Postgresql 9.1.2 - abnormal memory usage Date: Mon, 12 Dec 2011 00:45:23 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-rc5-andres; KDE/4.6.5; x86_64; ; ) References: <396904450.20111211221529@erwied.eu> In-Reply-To: <396904450.20111211221529@erwied.eu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112120045.23211.andres@anarazel.de> X-Pg-Spam-Score: -4.1 (----) X-Archive-Number: 201112/72 X-Sequence-Number: 31883 Hi, On Sunday, December 11, 2011 10:15:29 PM Jochen Erwied wrote: > The following script can be used to show the behaviour: > > create database pgtest; > \c pgtest > create table test(var inet); > insert into test(var) '127.0.0.0'::inet+generate_series(0,256*256*256-1); > create index test_ix on test(var); I can reproduce the issue. The memory is being spent at only one place: TopMemoryContext: 68688 total in 10 blocks; 2736 free (10 chunks); 65952 used TopTransactionContext: 8192 total in 1 blocks; 4856 free (0 chunks); 3336 used PortalMemory: 8192 total in 1 blocks; 7888 free (0 chunks); 304 used PortalHeapMemory: 15360 total in 4 blocks; 10640 free (17 chunks); 4720 used TupleSort: 6283429096 total in 723 blocks; 1424704 free (0 chunks); 6282004392 used Looking. Andres