﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25072	GDALRaster Garbage Collection not working	Daniel Wiesmann	nobody	"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."	Bug	closed	GIS	dev	Normal	fixed	memory gis raster		Ready for checkin	1	0	0	0	0	0
