Fixed memory consumption in a long running process