[postgis-devel] Geos_noop memory leak?

strk at refractions.net strk at refractions.net
Thu Feb 17 08:04:48 PST 2005


On Thu, Feb 17, 2005 at 04:23:53PM +0100, Markus Schaber wrote:
> Hi,
> 
> I think I might have found a memory leak in geos_noop.

GEOSnoop does nothing but converting geometries:
PostGIS->GEOS->PostGIS

If it leaks then *all* geos functions will leak.

If you're using GNU's libstdc++ >= 3.0 try setting
GLIBCPP_FORCE_NEW=1 in the environment, this would
disable late-deallocation, which is a *feature* of 
the library.

--strk;

> 
> This is my postmaster backend process after calling some non-geos GIS
> functions:
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 
>  6870 postgres  25   0 23784 8700 7760 S  0.0  0.8   0:35.81 postmaster
> 
> All three of VIRT, RES and SHR increased a lot during running the query,
> and dropped again when the query was finished. There is a small increase
> in RES and SHR memory usage after the _first_ call of each function,
> which seems to be caused by PostgreSQL loading the C function into
> memory. The memory usage keeps constant for repeated calls of the same
> function, or alternatinly calling already-initialized functions.
> 
> Now the same process after calling "select geosnoop(geom) from adminbndy1;":
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 
>  6870 postgres  25   0  138m 123m 7800 S  0.0 12.3   1:40.91 postmaster
> 
> 
> And after issuing the query a second time:
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 
>  6870 postgres  25   0  248m 233m 7800 S  0.0 23.1   2:07.31 postmaster
> 
> 
> Can anyone reproduce this? Does this occur with other GEOS functions, too?
> 
> Markus
> 
> --
> markus schaber | dipl. informatiker
> logi-track ag | rennweg 14-16 | ch 8001 zürich
> phone +41-43-888 62 52 | fax +41-43-888 62 53
> mailto:schabios at logi-track.com | www.logi-track.com



> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel




More information about the postgis-devel mailing list