pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rainer Mager <rmager@vgkk.com>
To: PostgreSQL Admin <pgsql-admin@postgresql.org>
Subject: High memory usage
Date: Thu, 14 Jun 2001 07:37:57 +0900
Message-ID: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com> (raw)

Hi all,

	We're seeing one usage of a database use significant more memory than
we're used to and I'm hoping for some hints at what Postgres allocates
memory for. BTW, we're running PG 7.1 on Linux.

	First of all we see some of the PG processes use as much as 80 MB
(according to top and ps). This seems to be allocated during a query
(SELECT). Unfortunately, we haven't been able to discover exactly what query
is doing this. Anyway, the first problem is this high memory allocation.
Considering the database is only about 80 MB total (according to disk usage
of the entire data directory), allocating 80 MB seems excessive.
	The second significant problem is that this memory allocation does not go
down once the SELECT is completed. According to ps the process in IDLE yet
the memory usage remains the same. If it was only one process then  that
would be fine but we see this happening with as many as 3 processes
simultaneously and the box only has 256 MB RAM (although we plan to up that
to 512 soon).

	So, if anyone has any general idea as to when PG allocates memory (for
example, I assume and hope, the PG process wouldn't allocate enough memory
to have the entire result set in memory) I'd appreciate the info. Any other
clues are also welcome.
	We have other, near identical, instances of this database which do not
show this behavior. The particular queries being done will differ between
them and one particular table is about 10 times larger (150,000 rows instead
of 15,000) in this db as compared to the others but I don't see either of
those factors causing this large a difference. Well, I don't know, how much
memory do semi-complex queries take?


Thanks,

--Rainer




view thread (11+ messages)  latest in thread

Message-ID: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com>
Permalink:  ../NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com/
Also on:    postgresql.org/message-id/NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rmager@vgkk.com
  Subject: Re: High memory usage
  In-Reply-To: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com>
  References: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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