"out of memory" error

From: Christian Schröder <cs(at)deriva(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: "out of memory" error
Date: 2007-08-22 17:07:20
Message-ID: 46CC6D48.20904@deriva.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,
I am struggling with some "out of memory" errors in our PostgreSQL
database which I do not understand. Perhaps someone can give me a hint.
The application which causes the errors runs multi-threaded with 10
threads. Each of the threads performs several select statements on the
database. Some of the statements are rather complicated (joins over
mulitple tables etc.) From time to time some of the statements lead to
"out of memory" errors. The errors are not reproducable and if I run the
statements alone everything works fine.

When I watch the output of "free -m" while the application runs, the
used memory (without buffers) is always near 500 MB:
total used free shared buffers
cached
Mem: 3954 3410 543 0 0
2942
-/+ buffers/cache: 467 3486
Swap: 2055 556 1498

These are the current settings from the server configuration:
shared_buffers = 3GB
work_mem = 8MB
maintenance_work_mem = 256MB
max_stack_depth = 4MB

The output of "ulimit -a" is as follows:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 38912
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 3441565
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 38912
virtual memory (kbytes, -v) 4922720
file locks (-x) unlimited

The machine is a linux box with 4 GB memory running PostgreSQL 8.2.4.

I can post the details about the memory status from the log file if it
is needed.

Are there any configuration parameters that influence the amount of
available memory (besides "shared_buffers" which seems to be high enough)?

Thanks for any help!
Christian

--
Deriva GmbH Tel.: +49 551 489500-42
Financial IT and Consulting Fax: +49 551 489500-91
Hans-Böckler-Straße 2 http://www.deriva.de
D-37079 Göttingen

Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2007-08-22 17:07:40 Re: Converting non-null unique idx to pkey
Previous Message Scott Marlowe 2007-08-22 15:47:25 Re: Postgres, fsync and RAID controller with 100M of internal cache & dedicated battery