Yes I do run out of memory very fast actually as the difference between allocated memory and freed memory is approximately 2GB at every iteration. I am almost certain it is not a normal behavior and there is something I do wrong.
I will try your suggestion and see how it goes. Thank you for your help.