some improvements for memory management of big rasters. vector.clear() doesnt free memory; it only frees memory when it goes out of scope. so a correct way of deallocation is in the unload method is to replace it with an empty vector which forces the original vector out of scope.