[postgis-devel] Memory in the Meantime

Paul Ramsey pramsey at opengeo.org
Wed Jan 7 08:50:42 PST 2009


Sounds like we are developing our 1.5/2.0 roadmap on the sly here, but
in the meantime, we have a gaping memory leak in the loader in 1.4.

I see that I can't just change lwfree_pointarray to deep-free, since
the lwfree_poly and lwfree_line calls in lwgeom will then try to free
const structures passed to us by PgSQL.

However, there is a half-thought-out concept of lwrelease_* in
liblwgeom, which seems to somewhat get there. I would propose that our
"in the meantime" strategy for this is:

lwfree_* is a deep free.
lwrelease_* will free everything down to just above the serialized piece

I'll fill out *all* the functions for lwrelease_ and then go retrofit
the existing lwfree_* calls in lwgeom to use lwrelease instead
(there's actually not that many, because... we are terrible memory
managers :).

Comments?

Paul



More information about the postgis-devel mailing list