Re: High memory usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rainer Mager" <rmager(at)vgkk(dot)com>
Cc: "PostgreSQL Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: High memory usage
Date: 2001-06-14 01:03:11
Message-ID: 15523.992480591@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc pgsql-patches

"Rainer Mager" <rmager(at)vgkk(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Anatoly K. Lasareff 2001-06-14 05:49:46 Re: Transactions and Locks writing in PLPGSQL
Previous Message Rainer Mager 2001-06-13 22:37:57 High memory usage

Browse pgsql-jdbc by date

  From Date Subject
Next Message George Koras 2001-06-14 08:15:42 Re: Failed Connection (again)
Previous Message Rainer Mager 2001-06-13 22:37:57 High memory usage

Browse pgsql-patches by date

  From Date Subject
Next Message Nathan Myers 2001-06-14 01:05:42 Re: Australian timezone configure option
Previous Message Bruce Momjian 2001-06-14 00:58:24 Re: Australian timezone configure option