I have got a memory issue due to the use of the zonal statistics command into a loop.

It seems that after using the ZS command QGIS stores some information in the RAM (cache memory?). It is not really an issue if you use it once but when it comes for a loop the memory capacity is quickly saturated and QGIS crashes.

Does anyone know where this information is kept and how I can get rid of it?

I already tried the command gc.enable() without any results.

1 Answer 1


Which version of QGIS are you using? QGIS < 2.8 had some severe memory leaks with the zonal statistics calculations, but these should be fixed in 2.8 and above.

  • I have got the 2.6.1 but it is the last available on the website right?
    – Sébastien
    Mar 6, 2015 at 7:38
  • Oh no your right the 2.8 is available thanks !
    – Sébastien
    Mar 6, 2015 at 7:41
  • I still have some issues regardlesss of the version.
    – Sébastien
    Mar 6, 2015 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.