Ticket #2002 (new defect)

Opened 10 months ago

Last modified 9 months ago

python bindings are leaking memory

Reported by: rouault Assigned to: hobu
Priority: normal Milestone: 1.6.0
Component: PythonBindings Version: svn-trunk
Severity: normal Keywords:
Cc: warmerdam

Description

I have run autotest under valgrind and found memory leaks in GDAL itself (most of them fixed now), but also in the python bindings themselves. I think one of them is OGRGeometry not being freed. Even without Valgrind, you can see it with the modified ogr_wkbwkt_geom.py (geometries created and destroyed in a huge loop). The python process memory doesn't stop increasing.

Attachments

ogr_wkbwkt_geom_bigloop.py (5.3 kB) - added by rouault on 11/18/07 10:03:27.
Modified version of ogr_wkbwkt_geom.py
ogr_wkbwkt_geom_valgrind_log.txt (18.4 kB) - added by rouault on 11/18/07 10:04:06.
Extract from "valgrind --trace-children=yes --leak-check=full ./ogr_wkbwkt_geom.py"
remaining_leaks_after_r12855.txt (16.5 kB) - added by rouault on 11/18/07 18:21:45.

Change History

11/18/07 10:03:27 changed by rouault

  • attachment ogr_wkbwkt_geom_bigloop.py added.

Modified version of ogr_wkbwkt_geom.py

11/18/07 10:04:06 changed by rouault

  • attachment ogr_wkbwkt_geom_valgrind_log.txt added.

Extract from "valgrind --trace-children=yes --leak-check=full ./ogr_wkbwkt_geom.py"

11/18/07 17:39:28 changed by hobu

I think this is fixed in r12851 for the ng bindings. Please regenerate and confirm.

11/18/07 18:21:45 changed by rouault

  • attachment remaining_leaks_after_r12855.txt added.

11/18/07 18:55:13 changed by hobu

  • cc set to warmerdam.

12/12/07 11:26:01 changed by hobu

Unless they are obvious or simple, I don't think we can do too much more on this one for 1.5. Two of the leaks (_Dict and ReadDir?) are related to swig typemaps that would need to be changed for all languages. It is too late for those kinds of changes...

12/15/07 17:44:01 changed by hobu

  • milestone changed from 1.5.0 to 1.6.0.

Kicking forward to 1.6...