Re: Programming error: Out of Memory - Mailing list pgsql-general

From Jorge Arévalo
Subject Re: Programming error: Out of Memory
Date
Msg-id AANLkTi=epoyTz+bU+q_-Lf7n0WWxkBjiXBzkm1i+T+wh@mail.gmail.com
Whole thread Raw
In response to Re: Programming error: Out of Memory  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
2010/11/16 Andy Colson <andy@squeakycode.net>:
> On 11/16/2010 3:55 PM, Jorge Arévalo wrote:
>>
>> 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
>>
>>
>>
>>
>>
>
> Probably the OOM, google: postgres oom
> there are lots and lots of pages about it.
>
> -Andy
>

Hi Andy,

Thanks for the tip. The only difference I see is the postgres process
is not killed after the error (maybe is restarted). Anyway, I'm going
to read about it.

Thanks again,

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

pgsql-general by date:

Previous
From: Christine Penner
Date:
Subject: Re: function problems
Next
From: Josh Berkus
Date:
Subject: Survey on backing up unlogged tables: help us with PostgreSQL development!