Re: Postgres utils chewing RAM

Steve Lane <slane@fmpro.com>

From: Steve Lane <slane@fmpro.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: <pgsql-general@postgresql.org>
Date: 2002-04-29T15:35:56Z
Lists: pgsql-general
On 4/29/02 12:53 AM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> Steve Lane <slane@fmpro.com> writes:
>> I seem to be having a problem with the postgres utilities chewing a lot of
>> RAM. I've been running PG 7.1 under LinuxPPC on a PowerMac G4. After a few
>> days of use, free memory degrades to almost nothing.
> 
> This is wrong?

Apparently not :->

Performance on the server seems to slowly degrade over time. I made the
naïve assumption that this correlated with free memory. This proceeded from
an almost (but not completely) absolute ignorance of how Unix manages
memory.

I am, suffice to say, educated.
> 
> On most Unixen, the kernel happily uses all spare RAM to cache
> recently-accessed disk blocks.  If you've got large amounts of "free"
> RAM it only means that (a) you rebooted recently, or (b) you're not
> doing much disk access.

> This all sounds like standard, expected, preferable behavior.
> 
> As soon as you run programs that need RAM, the kernel will drop those
> disk-cache pages and assign the RAM to program space.  But as long as
> you don't, what else should the kernel do with unused RAM than keep disk
> cache in it?
> 

OK, I need to a) learn more about memory management and b) dig deeper into
my (apparent) performance issues.

Thanks for the primer.

-- sgl