Unix Technical Forum

Re: Memory and/or cache issues?

This is a discussion on Re: Memory and/or cache issues? within the Pgsql Performance forums, part of the PostgreSQL category; --> Are you saying the kernel's disc cache may be getting whacked? No, I understand that PG should use as ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:44 AM
mcelroy, tim
 
Posts: n/a
Default Re: 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@sss.pgh.pa.us]
Sent: Friday, May 05, 2006 9:44 AM
To: mcelroy, tim
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Memory and/or cache issues?

"mcelroy, tim" <tim.mcelroy@bostonstock.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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:44 AM
Michael Stone
 
Posts: n/a
Default Re: Memory and/or cache issues?

On Fri, May 05, 2006 at 09:57:58AM -0400, mcelroy, tim wrote:
>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....


You need to be way more specific about what "in use" means. Try pasting
the output of actual commands like "free". The main problem here
according to the output you sent is that your process is trying to
allocate 10billion terabytes of RAM (which ain't gonna work) and dies.
That is not a memory issue.

Mike Stone

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 08:44 AM
Dave Dutcher
 
Posts: n/a
Default Re: Memory and/or cache issues?

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@postgresql.org
[mailtogsql-performance-owner@postgresql.org] On Behalf Of mcelroy,
tim
Sent: Friday, May 05, 2006 8:58 AM
To: 'Tom Lane'
Cc: pgsql-performance@postgresql.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@sss.pgh.pa.us]
Sent: Friday, May 05, 2006 9:44 AM
To: mcelroy, tim
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Memory and/or cache issues?

"mcelroy, tim" <tim.mcelroy@bostonstock.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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com