[postgis-tickets] [PostGIS] #4163: ST_AsMVT: Resource leak (was: ST_AsMVT: Resource leak under parallel plans)

PostGIS trac at osgeo.org
Tue Aug 28 09:34:59 PDT 2018


#4163: ST_AsMVT: Resource leak
-------------------------+---------------------------
  Reporter:  Algunenano  |      Owner:  Algunenano
      Type:  defect      |     Status:  assigned
  Priority:  high        |  Milestone:  PostGIS 2.5.0
 Component:  postgis     |    Version:  2.4.x
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by Algunenano):

 After investigating further I've discovered that this leak isn't caused by
 parallel plans, it just turned out to appear in the same tests where I get
 those plans.

 The issue is in `mvt_agg_transfn` as it parses the columns `if
 (layer->n_features == 0)` which, in theory, should be only once.
 The problem comes when the first (or first N) row has a NULL geometry
 since that will go through the transformation without increasing
 `layer->n_features`.

 In 2.4 this only meant unnecessary work, but in 2.5+ it means allocating
 memory again and leaking the resources from the previous call.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4163#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list