Re: Memory and/or cache issues?

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'mcelroy, tim'" <tim(dot)mcelroy(at)bostonstock(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Memory and/or cache issues?
Date: 2006-05-05 14:31:33
Message-ID: 007d01c67050$9bf11340$8300a8c0@tridecap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

For a standard config most of the memory used by Postgres is the shared
buffers. The shared buffers are a cache to store blocks read from the
disk, so if you do a query, Postgres will allocate and fill the shared
buffers up to the max amount you set in your postgresql.conf file.
Postgres doesn't release that memory between queries because the point
is to be able to pull data from ram instead of the disk on the next
query.

Are you sure your settings in postgresql.conf are standard? What are
your settings for shared_buffers and work_mem?

-----Original Message-----
From: pgsql-performance-owner(at)postgresql(dot)org
[mailto:pgsql-performance-owner(at)postgresql(dot)org] On Behalf Of mcelroy,
tim
Sent: Friday, May 05, 2006 8:58 AM
To: 'Tom Lane'
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Memory and/or cache issues?

Are you saying the kernel's disc cache may be getting whacked? No, I
understand that PG should use as much memory as it can and the system as
well. The main problem here is that with almost all the 8GB of RAM 'in
use' when I try to do a pg_dump or vacuumdb I run out of memory and the
system crashes....

I well understand that unused memory is not a good thing, just that when
you have none and can't do the maint work....bad stuff happens. For
example, I just created a benchdb on my DEV box with 1,000,000 tuples.
As this ran the mem in use jumped up 1G and it hasn't gone down? Once
the PG process has finished its task shouldn't it release the memory it
used?

Thanks,
Tim

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Friday, May 05, 2006 9:44 AM
To: mcelroy, tim
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Memory and/or cache issues?

"mcelroy, tim" <tim(dot)mcelroy(at)bostonstock(dot)com> writes:
> I see this on all the postgres installations, no matter what I
> set the postgresql.conf settings to regarding memory allocation, once
> postgres starts up 95% of the memory on the box is used. Is there a
way
> within Linux to 'see' what or who is actually using this memory?

Probably kernel disk cache. Are you under the misimpression that unused

memory is a good thing? If a Unix-ish system *isn't* showing near zero
free memory under load, the kernel is wasting valuable resources.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message mcelroy, tim 2006-05-05 14:36:19 Re: Memory and/or cache issues?
Previous Message mcelroy, tim 2006-05-05 14:27:10 Re: Memory and/or cache issues?