[geos-devel] CPU buildup with repeated operations

Mateusz Loskot mateusz at loskot.net
Sat Mar 7 07:45:53 EST 2009

thep wrote:
> Hi, am having a problem with a system built using GEOS, wondering if anyone
> could help. Am using GEOS to generate sound and graphics from geom
> operations in realtime. If I do a constant amount of work (e.g. roughly 150
> binary operations per second)  then gradually my CPU usage builds up, until
> after about 5 minutes, it becomes unusable. This is whilst carrying out the
> same amount of operations. 
> Am using the C API on an Intel Core 2, can anyone think what this might be?

What is memory usage? Does it increase significantly?
Chances are that if your program uses a lot of memory
then your system starts swapping, what uses CPU time quite a lot too.

> As far as I'm aware I'm destroying all objects after each set of operations,
> but if I've missed one (and therefore have a constantly increasing number of
> objects), does GEOS perform any housekeeping on created objects which could
> cause this CPU buildup?

I'd suggest to check if your program does proper cleanup, run it through
valgrind and check for memory leaks.

> The other thing I've considered is could it be an
> Intel denormalization issue? 

I'm not sure about that, but AFAIK this problem applies only to P4 and
prior CPUs from Intel CPUs. But you are using their successors actually.

Anyway, you may want to confirm this in Intel docs.

Best regards,
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

More information about the geos-devel mailing list