#25072: GDALRaster Garbage Collection not working
----------------------------+-------------------------------
Reporter: yellowcap | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Normal | Keywords: memory gis raster
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+-------------------------------
I noticed that when creating many `GDALRasters` in a single context, the
memory allocated to GDALRasters does not get released properly. For
instance, the following loop as an ever growing memory consumption:
{{{
from django.contrib.gis.gdal import GDALRaster
n = 1000
for x in range(n):
rast = GDALRaster({
'driver': 'MEM',
'width': 500,
'height': 500,
'nr_of_bands': 1,
'srid': 3086,
'origin': (500000, 400000),
'scale': (1, -1),
'skew': (0, 0),
'bands': [{
'nodata_value': 10,
'data': range(500**2)
}],
})
}}}
Adding `rast.__del__()` to the loop solves the problem, but I guess that
should be automatic.
--
Ticket URL: <https://code.djangoproject.com/ticket/25072>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.02c696fe02c12b3ec28020dbcf7d1319%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.