High memory usage

From: "Rainer Mager" <rmager(at)vgkk(dot)com>
To: "PostgreSQL Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: High memory usage
Date: 2001-06-13 22:37:57
Message-ID: NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc pgsql-patches

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2001-06-14 01:03:11 Re: High memory usage
Previous Message Tom Lane 2001-06-13 19:05:58 Re: Broken Tables?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2001-06-14 01:03:11 Re: High memory usage
Previous Message Tom Lane 2001-06-12 23:07:03 Re: Re: [JDBC] unlink large objects

Browse pgsql-patches by date

  From Date Subject
Next Message Thomas Lockhart 2001-06-14 00:23:22 Re: Australian timezone configure option
Previous Message Peter Eisentraut 2001-06-13 21:14:38 Re: Re: [PATCHES] Fw: Isn't pg_statistic a security hole - Solution Proposal