<div><span class="Apple-style-span" style="font-size: 13px; ">Hi guys,<br>i recently asked the same question on the postgresql mailing list but they forwarded me to this mailing list.</span></div><div><span class="Apple-style-span" style="font-size: 13px; ">I really hope you can help me :)</span></div><div><br></div><div><span class="Apple-style-span" style="font-size: 13px; ">on a test maschine from my university i'm running into a weird problem (i attached detail info):<br><br>A running postgis query eats more and more memory.(seen in htop) </span></div><div><span class="Apple-style-span" style="font-size: 13px; ">It'll start using virtual memory and after eating up that one, too, postgres will<br>crash with:<br><br>psql:/home/mguether/sql/benchmark.sql:6: NOTICE:  std::bad_alloc<br>psql:/home/mguether/sql/benchmark.sql:6: ERROR:  GEOS intersects()<br>threw an error!<br><br>once it gave me an<br>psql:/home/mguether/sql/benchmark.sql:6: ERROR:  out of memory<br>DETAIL:  Failed on request of size 182949.<br><br>after the crash, all memory/swap is free again, so it really is postgres :)<br><br>i don't really know how to debug it any more detailed or fix this<br>issue in any way.<br><br>Does anyone here have a hint, where the issue might be?<br><br>thanks,<br></span><span class="Apple-style-span" style="font-size: 13px; ">martin<br><br><br><br><br><br><br><br>here some information:<br><br>the maschine:<br>16 GB RAM, i7 4cores x64 2.6.32-21-server ubuntu<br><br>installed postgres:<br>psql (PostgreSQL) 8.4.9<br>including postgis<br>POSTGIS="1.4.0" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.7.1, 23 September<br>2009" USE_STATS<br><br>i changed two parameters from the default config:<br>shared_buffers = 512MB<br>work_mem = 256MB<br><br>using osm2pgsql I important some GEO data, and want to execute this query:<br><br>SELECT a.osm_id, w.osm_id FROM "planet_osm_line" w,<br>"planet_osm_polygon" a WHERE ST_Intersects(w.way,a.way) AND w.highway<br>IS NOT NULL;<br><br>the EXPLAIN gives me:<br><br>Nested Loop  (cost=0.00..26427424.16 rows=1511021 width=8)<br>  Join Filter: _st_intersects(w.way, a.way)<br>  ->  Seq Scan on planet_osm_line w  (cost=0.00..49213.10<br>rows=1137488 width=837)<br>        Filter: (highway IS NOT NULL)<br>  ->  Index Scan using osm_areas_index on planet_osm_polygon a<br>(cost=0.00..23.10 rows=6 width=824)<br>        Index Cond: (w.way && a.way)<br>(6 rows)</span></div><div></div><div></div><div></div><div></div><div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-size: 13px; "><br></span></div><div></div>