pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
What's using all my RAM?
6+ messages / 5 participants
[nested] [flat]

* What's using all my RAM?
@ 2006-08-02 04:09 adey <adey11@gmail.com>
  2006-08-02 04:37 ` Re: What's using all my RAM? Tom Lane <tgl@sss.pgh.pa.us>
  2006-08-02 16:34 ` Re: What's using all my RAM? Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 2 replies; 6+ messages in thread

From: adey @ 2006-08-02 04:09 UTC (permalink / raw)
  To: pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@Groups.ittoolbox.com>

Please could someone tell me how to discover what is using all of my RAM?
I am trying to run a vacuum against Postgres, but it fails immediately
with:-

"ERROR:  out of memory
DETAIL:  Failed on request of size 1073741820."

TOP shows the following:-
Mem:   4077544k total,  3897868k used,   179676k free,   146960k buffers
Swap:  2000084k total,      440k used,  1999644k free,  3352892k cached
None of the listed processes appear to be using more than 1 or 2% MEM.

Postgres v7.4.2 (upgrade underway)

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: What's using all my RAM?
  2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
@ 2006-08-02 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  2006-08-02 04:47   ` Re: What's using all my RAM? Michael Fuhr <mike@fuhr.org>
  1 sibling, 1 reply; 6+ messages in thread

From: Tom Lane @ 2006-08-02 04:37 UTC (permalink / raw)
  To: adey <adey11@gmail.com>; +Cc: pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@Groups.ittoolbox.com>

adey <adey11@gmail.com> writes:
> Please could someone tell me how to discover what is using all of my RAM?
> I am trying to run a vacuum against Postgres, but it fails immediately
> with:-

> "ERROR:  out of memory
> DETAIL:  Failed on request of size 1073741820."

I'd bet lunch that this is a corrupt-data problem, not an out-of-memory
problem --- specifically, a bad value in a field length word.  See the
archives for many prior examples.

> Postgres v7.4.2 (upgrade underway)

Yipes :-(

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: What's using all my RAM?
  2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
  2006-08-02 04:37 ` Re: What's using all my RAM? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 04:47   ` Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Fuhr @ 2006-08-02 04:47 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: adey <adey11@gmail.com>; pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@Groups.ittoolbox.com>

On Wed, Aug 02, 2006 at 12:37:47AM -0400, Tom Lane wrote:
> adey <adey11@gmail.com> writes:
> > Please could someone tell me how to discover what is using all of my RAM?
> > I am trying to run a vacuum against Postgres, but it fails immediately
> > with:-
> 
> > "ERROR:  out of memory
> > DETAIL:  Failed on request of size 1073741820."
> 
> I'd bet lunch that this is a corrupt-data problem, not an out-of-memory
> problem --- specifically, a bad value in a field length word.  See the
> archives for many prior examples.

1073741820 = 3ffffffc = 00111111111111111111111111111100

That doesn't explain anything but it's an interesting-looking number.

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: What's using all my RAM?
  2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
@ 2006-08-02 16:34 ` Scott Marlowe <smarlowe@g2switchworks.com>
  2006-08-02 23:23   ` Re: What's using all my RAM? adey <adey11@gmail.com>
  2006-08-08 16:29   ` Re: What's using all my RAM? Jim Nasby <jnasby@pervasive.com>
  1 sibling, 2 replies; 6+ messages in thread

From: Scott Marlowe @ 2006-08-02 16:34 UTC (permalink / raw)
  To: adey <adey11@gmail.com>; +Cc: pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@Groups.ittoolbox.com>

On Tue, 2006-08-01 at 23:09, adey wrote:
> Please could someone tell me how to discover what is using all of my
> RAM?
> I am trying to run a vacuum against Postgres, but it fails immediately
> with:-
>  
> "ERROR:  out of memory
> DETAIL:  Failed on request of size 1073741820."
>  
> TOP shows the following:-
> Mem:   4077544k total,  3897868k used,   179676k free,   146960k
> buffers
> Swap:  2000084k total,      440k used,  1999644k free,  3352892k
> cached
> None of the listed processes appear to be using more than 1 or 2% MEM.

nothing is using your ram in the traditional sense.You're kernel is
caching files in the space that's not currently being used by
applications.  note that you show 3897868k used, and 3352892k cached. 
So, the actual memory being use by applications is the in use minus the
cached, or about 544,000k.  The rest is actually available, and the
kernel will gladly give it back if a program needs it.

You actual problem here is that your machine is trying to allocate
approx 1 Gig at once.  Large allocations tend to point towards some kind
of data corruption in your database, but not always.

Try a vacuuming each table one at a time to see which one is causing
this error (if it's not already in the error message and got edited
away.)  See if a select of all rows on that table gets the same error
message.

> Postgres v7.4.2 (upgrade underway)

If you can get a clean backup, look into at least 8.0.  There were huge
improvements from 7.4 to 8.0. 8.1 is even more impressive. (says the DBA
who's still running 7.4.13  on all his boxes... :)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: What's using all my RAM?
  2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
  2006-08-02 16:34 ` Re: What's using all my RAM? Scott Marlowe <smarlowe@g2switchworks.com>
@ 2006-08-02 23:23   ` adey <adey11@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: adey @ 2006-08-02 23:23 UTC (permalink / raw)
  To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@groups.ittoolbox.com>

Thanks for this.
I couldn't get vacuum to run on even the smallest table, so I
re-investigated RAM. We changed our SHMMAX to 1.3gb on this 4gb RAM system
in line with the systems we have already converted to Postgres 8.1.4, but v8
handles RAM differently (vacuum_mem replaced with maintenance_work_mem), and
SHMMAX usage has changed (v8 uses less SHMMAX - about 300mb - where v7 grabs
all 1.3gb and holds it), so when vacuum tried to run and get 1gb of RAM on
v7, it failed. We reduced vacuum_mem to 8192kb on v7 and the vacuum runs
happily with SHMMAX at 1.3gb.


On 8/3/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
>
> On Tue, 2006-08-01 at 23:09, adey wrote:
> > Please could someone tell me how to discover what is using all of my
> > RAM?
> > I am trying to run a vacuum against Postgres, but it fails immediately
> > with:-
> >
> > "ERROR:  out of memory
> > DETAIL:  Failed on request of size 1073741820."
> >
> > TOP shows the following:-
> > Mem:   4077544k total,  3897868k used,   179676k free,   146960k
> > buffers
> > Swap:  2000084k total,      440k used,  1999644k free,  3352892k
> > cached
> > None of the listed processes appear to be using more than 1 or 2% MEM.
>
> nothing is using your ram in the traditional sense.You're kernel is
> caching files in the space that's not currently being used by
> applications.  note that you show 3897868k used, and 3352892k cached.
> So, the actual memory being use by applications is the in use minus the
> cached, or about 544,000k.  The rest is actually available, and the
> kernel will gladly give it back if a program needs it.
>
> You actual problem here is that your machine is trying to allocate
> approx 1 Gig at once.  Large allocations tend to point towards some kind
> of data corruption in your database, but not always.
>
> Try a vacuuming each table one at a time to see which one is causing
> this error (if it's not already in the error message and got edited
> away.)  See if a select of all rows on that table gets the same error
> message.
>
> > Postgres v7.4.2 (upgrade underway)
>
> If you can get a clean backup, look into at least 8.0.  There were huge
> improvements from 7.4 to 8.0. 8.1 is even more impressive. (says the DBA
> who's still running 7.4.13  on all his boxes... :)
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: What's using all my RAM?
  2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
  2006-08-02 16:34 ` Re: What's using all my RAM? Scott Marlowe <smarlowe@g2switchworks.com>
@ 2006-08-08 16:29   ` Jim Nasby <jnasby@pervasive.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Jim Nasby @ 2006-08-08 16:29 UTC (permalink / raw)
  To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: adey <adey11@gmail.com>; pgsql-admin; PostgreSQL Admin <postgres@productivitymedia.com>; postgresql-l <postgresql-l@Groups.ittoolbox.com>

On Aug 2, 2006, at 11:34 AM, Scott Marlowe wrote:
>> Postgres v7.4.2 (upgrade underway)
>
> If you can get a clean backup, look into at least 8.0.  There were  
> huge
> improvements from 7.4 to 8.0. 8.1 is even more impressive. (says  
> the DBA
> who's still running 7.4.13  on all his boxes... :)

Most importantly, you're running the most recent version of 7.4. The  
OP needs to run (not walk) to 7.4.13.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2006-08-08 16:29 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-02 04:09 What's using all my RAM? adey <adey11@gmail.com>
2006-08-02 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 04:47   ` Michael Fuhr <mike@fuhr.org>
2006-08-02 16:34 ` Scott Marlowe <smarlowe@g2switchworks.com>
2006-08-02 23:23   ` adey <adey11@gmail.com>
2006-08-08 16:29   ` Jim Nasby <jnasby@pervasive.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox