#12101 closed (fixed)
django.contrib.gis.gdal.OGRGeometry leaking memory
Reported by: | Owned by: | jbronn | |
---|---|---|---|
Component: | GIS | Version: | 1.1 |
Severity: | Keywords: | GDAL, memory, leak | |
Cc: | techlog@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
gdal.OGRGeometry from WKB and WKT leaks memory like crazy (using GDAL 1.6.0, on debian). Reference counts do not appear to go up, but memory climbs rapidly.
From WKB:
from django.contrib.gis.geos import Point from django.contrib.gis import gdal geom = Point(1,1) geom.srid = 4326 for i in xrange(1000000): g = gdal.OGRGeometry(geom.wkb, geom.srid) del g
From WKT:
from django.contrib.gis.geos import Point from django.contrib.gis import gdal geom = Point(1,1) geom.srid = 4326 for i in xrange(1000000): g = gdal.OGRGeometry(geom.wkt, geom.srid) del g
Attachments (1)
Change History (5)
comment:1 by , 15 years ago
milestone: | → 1.2 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
by , 15 years ago
Attachment: | gdal_leak_fix.diff added |
---|
Fixes memory leak when assigning SpatialReference to OGRGeometry
comment:2 by , 15 years ago
I've come up with a patch that works, and all tests pass with it. However I can't fully explain yet why it works over the previous version, other than that somehow the cloned SpatialReference
object references (within OGR, not Python) were not being released. As soon as I can explain why those references were not being released, I'll commit the patch.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've confirmed this is as a bug, the leak is real. I think it's within the
SpatialReference
code because there's no balloon in memory usage when I change to this: