From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rainer Mager <rmager@vgkk.com>
Cc: PostgreSQL Admin <pgsql-admin@postgresql.org>
Subject: Re: High memory usage
Date: Wed, 13 Jun 2001 21:03:11 -0400
Message-ID: <15523.992480591@sss.pgh.pa.us> (raw)
In-Reply-To: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com>
References: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com>
"Rainer Mager" <rmager@vgkk.com> writes:
> 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.
If you can catch the thing while the memory usage is going up, you could
attach to the backend with gdb and examine debug_query_string to see
what the current query is. (Note: I think you need 7.1.1 or later to
have this variable available. You should be on 7.1.2 in any case, just
on general principles.) Otherwise, consider turning on query logging
and see if you can correlate log entries with the memory consumption.
> 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.
Very few Unix programs of any description will release memory back to
the OS before process exit. Postgres is no different. Start a fresh
backend if you need to cut down the memory usage.
There's not a lot more we can say about it until you can identify the
query that sucks up all the space. 7.1 in general is a lot better about
memory consumption than prior releases, but it sounds like you may have
found a leak that's not plugged yet. I would like to know about it when
you identify the problem query.
regards, tom lane
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: tgl@sss.pgh.pa.us, rmager@vgkk.com
Subject: Re: High memory usage
In-Reply-To: <15523.992480591@sss.pgh.pa.us>
References: <NEBBJBCAFMMNIHGDLFKGIEEJEEAA.rmager@vgkk.com> <15523.992480591@sss.pgh.pa.us>
* 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