[geos-devel] Memory leaks (?) experienced with WKTReader and WKBWriter

Manos Karpathiotakis mk at di.uoa.gr
Mon May 16 08:22:31 EDT 2011

Hi all!!

I am currently using geos 3.2.0 in an implementation of mine. The classes I
am mainly using are Geometry, WKTReader and WKBWriter.

However, after examining my code with valgrind, it seems that I am
experiencing memory leaks from the two WKT classes.
The block of code that contains those is the following:

WKTReader* reader;
WKBWriter* writer;
for (unsigned i = 1; i <= 1000000000; i++) {
                //create the wkt geometry...

                string wkt = sObj.str();
Geometry* geom = (*reader).read(wkt);
//delete reader;

The lines commented at the end of the block are my attempts to perform
garbage collection manually.
So, my question is the following: Is there a specific way to destroy the
Is it possible to avoid the leaks I am experiencing?

Thanks a lot,

Manos Karpathiotakis
National & Kapodistrian University of Athens
Department of Informatics & Telecommunications, Office B25
Management of Data & Information Knowledge Group
Panepistimioupolis, Ilissia
GR-15784 Athens, Greece
Tel: +30.210.727.5159
Fax: +30.210.727.5214
e-mail: mk at di.uoa.gr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20110516/4e24b099/attachment.html

More information about the geos-devel mailing list