[geos-devel] PostGIS Leak

strk strk at keybit.net
Fri Oct 24 04:48:45 EDT 2003


Postgis does definely have leaks. I removed a few but please
report any repeated-query-makes-postgres-process-size-grow
occurrence since that way it will be easier and quicker.

Right now I'm hunting for a 12bytes leak in geomunion.

Note that in order to avoid "smart" memory caching you might
need to export GLIBCPP_FORCE_NEW=1 before running postgres
for gcc>=3.2.2 while you'll have to compile both GEOS and
postgis/postgis_geos_wrapper.cpp using -D__USE_MALLOC CXXFLAG
for gcc 2.91, 2.95, 3.0 and 3.1.

--strk;

strk wrote:
> Hope this is the last one.
> I got g++-3.3.2 / libstdc++5-3.3
> exporting GLIBCPP_FORCE_NEW=1 and running doc/example
> through valgrind make the following statement:
> 
> ==20854== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> ==20854== malloc/free: in use at exit: 0 bytes in 0 blocks.
> ==20854== malloc/free: 6248 allocs, 6248 frees, 207321 bytes allocated.
> ==20854== For counts of detected errors, rerun with: -v
> ==20854== No malloc'd blocks -- no leaks are possible.
> 
> FINALLY! :DD
> 
> I'm now checking postgis leaks
> 
> --strk;
> 
> strk wrote:
> > me wrote:
> > > Strangely enough your example runs fine on my system and I get no segfault while
> > > printing the point.
> > > 
> > > Yury
> > 
> > I finally upgraded compiler to version 3.0 and... Magic !
> > Segfault disappeared. I can finally disable gcc's "smart"
> > memory magic and... Surprise ! There seems to be a bug
> > somewhere.. I get a segfault when deleting the vector
> > used as input to GeometryCollection constructor (a just
> > in time real life example of consistency issues).
> > 
> > The bug probably does not show up due to memory caching smartness.
> > 
> > I'll inspect on this. BTW to disable memory caching with gcc 2.91,
> > 2.95, 3.0, 3.1 export CXXFLAGS=-D__USE_MALLOC and re-compile both
> > geos and example.cpp. For gcc >= 3.2.2 export GLIBCPP_FORCE_NEW
> > and/or GLIBCXX_FORCE_NEW at runtime.
> > 
> > --strk;
> > 
> > 
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at geos.refractions.net
> > http://geos.refractions.net/mailman/listinfo/geos-devel
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel



More information about the geos-devel mailing list