Sort memory not being released - Mailing list pgsql-general

From Jim C. Nasby
Subject Sort memory not being released
Date
Msg-id 20030616013132.V66185@flake.decibel.org
Whole thread Raw
Responses Re: Sort memory not being released  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@nasby.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?"

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Index not being used in MAX function (7.2.3)
Next
From: Bruno Wolff III
Date:
Subject: Re: Lyris -> PG 7.1.3