Re: Postgresql 9.1.2 - abnormal memory usage

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-bugs(at)postgresql(dot)org, Jochen Erwied <jochen(at)pgsql-bugs(dot)erwied(dot)eu>
Subject: Re: Postgresql 9.1.2 - abnormal memory usage
Date: 2011-12-12 00:45:42
Message-ID: 201112120145.42463.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Monday, December 12, 2011 12:45:23 AM Andres Freund wrote:
> 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
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.

Jochen, could you try the attached patch?

Andres

Attachment Content-Type Size
0001-Release-memory-in-inet-functions.patch text/x-patch 4.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John Lumby 2011-12-12 00:55:32 Re: LIKE predicate and ERROR: 42P22: could not determine which collation to use for string comparison - HINT: Use the COLLATE clause ...
Previous Message Andres Freund 2011-12-11 23:45:23 Re: Postgresql 9.1.2 - abnormal memory usage