Programming error: Out of Memory

From: Jorge Arévalo <jorge(dot)arevalo(at)deimos-space(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Programming error: Out of Memory
Date: 2010-11-16 21:55:49
Message-ID: AANLkTimjGa_pb4_iuU1s-Xqxm=_JzoaOsZgCjzkiTPxZ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I'm getting an error message in my Python script:

pg.ProgrammingError: ERROR: out of memory
DETAIL: Failed on request of size 16.

The query that caused the error was:

UPDATE table1 SET string = (SELECT string FROM table2 WHERE
ST_Centroid(table1.wkb_geometry) && table2. the_geom AND
(ST_Distance(ST_Centroid(table1.wkb_geometry), table2.the_geom)<=0)
LIMIT 1 OFFSET 0) WHERE string is null;

table1: a table with one geometry column of type "polygon" (square
polygons). 1277500 rows.
table2: a table with one geometry column of type "polygon". A few rows (12).

Both geometry columns have gist indexes over them.

This query was executed inside a loop, with another 10 similar
queries, using table1 against different tables (table2, table3,
table4, etc). The error is not always produced in the same part of the
loop (sometimes with table2, sometimes with table3...). I attach the
relevant part of PostgreSQL log.

My enviroment: Ubuntu 10.10, PostgreSQL 8.4, PostGIS 1.5.2, 2GB RAM
Things I've tried: Increase the SHMMAX kernel variable from 32MB to
128MB. Increase SHMALL too. Change postgresql.conf parameters
shared_buffers to 120MB, work_mem to 32MB, effective_cache_size to
128MB. Didn't work.

I think it's a problem with data, because I've tested this other times
with other data at worked. What could be happening?

Many thanks in advance

--
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge(dot)arevalo(at)deimos-space(dot)com
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com

Attachment Content-Type Size
postgresql_error_log.txt text/plain 7.5 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christine Penner 2010-11-16 21:57:32 Re: function problems
Previous Message Raymond O'Donnell 2010-11-16 21:54:53 Re: function problems