https://issues.qgis.org/https://issues.qgis.org/favicon.ico2018-01-29T23:21:31ZQGIS Issue TrackingQGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=863582018-01-29T23:21:31ZNyall Dawson
<ul></ul><p>Nathan reports that the leak is also present in the QgsFeature python code - e.g. calling <code>feature[0]</code> or <code>feature['my_attr']</code> will leak if the attribute is NULL.</p>
<p>To be precise - it's not technically a memory leak, it's just that Python is not garbage collecting these values.</p> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=863592018-01-30T00:00:03ZNathan Woodrow
<ul></ul><p>The following code also seems to show the issue</p>
<pre>
ids = set()
def leakme():
count = 0
for f in iface.activeLayer().getFeatures():
a = f[4]
ids.add(id(a))
if count == 1000:
break
count += 1
leakme()
print(ids)
</pre> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=868662018-02-18T23:23:07ZNathan Woodrow
<ul></ul><p>@Nayll This one is fixed now isn't it?</p> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=868672018-02-19T03:58:28ZNyall Dawson
<ul></ul><p>Let me verify a few other things first - I did see evidence of another similar leak at one stage.</p> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=873152018-02-22T18:54:50ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=902372018-06-08T11:58:41ZDenis Rouzauddenis.rouzaud@gmail.com
<ul></ul><p>Nyall, can this be closed?</p> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=921442018-08-25T14:46:47ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Hi, what is the status of this issue?</p> QGIS Application - Bug report #17985: Huge memory leak with QgsFeature.attributes() in Pythonhttps://issues.qgis.org/issues/17985?journal_id=921602018-08-25T20:18:16ZNyall Dawson
<ul><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Fixed</p>