Sort memory not being released

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Sort memory not being released
Date: 2003-06-16 06:31:32
Message-ID: 20030616013132.V66185@flake.decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wasn't sure if this should go to hackers or not, so here it is...

It appears that after a pgsql backend uses memory for sort, it doesn't
get released again, at least on solaris. IE:

17660 jnasby 1 0 0 430M 423M cpu3 82:49 0.00% postgres
17662 jnasby 1 58 0 94M 81M sleep 6:29 0.00% postgres
17678 jnasby 1 58 0 80M 72M sleep 1:06 0.00% postgres
17650 jnasby 1 58 0 46M 2112K sleep 0:00 0.00% postgres

In this case, I have shared buffers set low and sort mem set really high
(5000 and 350,000) to try and avoid sorts going to disk.

Even if my settings are bad for whatever reason, shouldn't sort memory
be released after it's been used? Before I had sort set to 20,000 and I
still saw pgsql processes using more than 50M even when idle.

Of course this isn't an issue if you disconnect frequently, but it
really would hurt if you were using connection pooling.
--
Jim C. Nasby (aka Decibel!) jim(at)nasby(dot)net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-16 07:53:40 Re: Lyris -> PG 7.1.3
Previous Message Jim C. Nasby 2003-06-16 06:12:33 Re: Index not being used in MAX function (7.2.3)