[Qgis-developer] Possible memory leak in rendering code

Nyall Dawson nyall.dawson at gmail.com
Mon Apr 22 14:12:09 PDT 2013

> By the way, it would be a good thing to remove render caching
> completely before 2.0. In any case it will need to be reworked when
> moving to multi-threaded rendering... it has only a limited
> functionality of storing previously rendered map in each layer and
> reusing it in case the extent has not changed. Unfortunately the
> rendered image is stored directly within QgsMapLayer class - in order
> to work properly, the cache should be kept internally within each
> QgsMapRenderer instance.

-1 from me -- please don't do this! I realise that it has some
limitations, but render caching makes a huge difference in speed with
my workflow.

I frequently use layers based off complex PostGIS views which take a
long time to generate. With render caching I'm able to selectively
toggle layers on/off or rearrange them for comparison without having
to wait for QGIS to request a new version of the view from the PostGIS
server. If I switch off render caching then every change to layer
visibility or ordering triggers a refresh of the view and a painful
wait in QGIS.

Obviously an ideal solution would be to cache the PostGIS layer
locally, but until that's possible render caching helps a lot...


More information about the Qgis-developer mailing list