Is there some reason you can't add more swap space?
Yes, disk space. I have about 2 GB of swap space enabled.
How do you know it is Postgres that is using lots of memory? The OOM killer
doesn't just kill of memory hogs, so you can't just assume the processes
being killed tells you which processes were using lots of memory.
I keep 'top' running while I launch the query. One single postmaster
climbs to the top, claiming 98% MEM and about 8% CPU.
The memory that Postgres uses is controlled in postgresql.conf. One particular
gotcha is that sortmem is per sort, so if you have a number of concurrent
sorts you might be using more memory than you expected.
I am very sure there are no other queries running at the same time. This
is a development machine of which I have full control.
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq