Hi,
I use a Python-Script to load all shapefiles in a directory tree one by one and 
export the sld-files.
It works fine, but slows down incredible after ~100 files.
So I tried the following barebone script with just the essentials  (load 
shapefile, add it to the map canvas, remove it again and then clear the 
project) in a loop and I get the same behavior...

from datetime import datetime
for i in range(1, 1000):
                vlayer=QgsVectorLayer ("aShapeFile.shp" ,"run  " + str(i) + " 
at " + datetime.now().strftime('%H:%M:%S') ,"ogr")
                QgsProject.instance().addMapLayer(vlayer)
                QgsProject.instance().removeMapLayer(vlayer.id())
                QgsProject.instance().clear()

Same result,  the Script slows down after every iteration in the loop AND 
QGIS-memory consumption goes up!
Do I need to do some garbage cleaning / what am I doing wrong / is this a 
Memory leak?

Thanks everybody for any hints / help!

Peter

_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to