Hello again, the memory leak has definitely something to do with the writer as everything works well when I run my script without it. Is there any other way to delete the writer after a file has been processed? Best, Sebastian