Re: Is it a memory leak in PostgreSQL 7.4beta? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is it a memory leak in PostgreSQL 7.4beta?
Date
Msg-id 5056.1063202598@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is it a memory leak in PostgreSQL 7.4beta?  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: Is it a memory leak in PostgreSQL 7.4beta?
List pgsql-hackers
Manfred Koizar <mkoi-pg@aon.at> writes:
> On Wed, 10 Sep 2003 00:18:52 -0400, Tom Lane <tgl@sss.pgh.pa.us>
> wrote:
>> I have a suspicion that there is no real leak, but
>> rather we are seeing some artifact of the way Linux' top(1) reports
>> memory usage.

> From my experience I can confirm that.  I have looked a lot at top
> output when I benchmarked my heaptuple header changes last year.  ISTM
> Linux accounts a shared memory page (for whatever a page is) to the
> memory usage of a process as soon as the process has touched that
> page.

But not otherwise, huh?  Okay, that would explain things.

> 7.4 starts up with 1000 shared buffers by default, that is 8 MB of
> shared memory.  Add some space for FSM, connections and other shared
> stuff, and 10 MB of shared memory is quite plausible.

In fact, according to ipcs, the default shared memory segment size for
CVS tip on Linux (RHL 8.0) is 10436608 bytes.  I see that a freshly
started backend is shown as having SHARE 1896, but a large seqscan query
(which would cause it to touch all the shared buffers in fairly short
order) makes the report jump to 6500.  This doesn't seem to quite square
with your explanation though --- surely the number should go to 8000 and
change?  The man page for top says these numbers are in kilobytes ...
but if they were really measured in, say, 4K pages, then we'd be talking
about 26M of shared memory touched, which might be plausible when you
consider shared libraries.  2K pages would make the numbers even more
plausible, but that seems like an unlikely page size.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Stats Collector Error 7.4beta1 and 7.4beta2
Next
From: Bruce Momjian
Date:
Subject: Re: Stats Collector Error 7.4beta1 and 7.4beta2