After every call of grabToImage some memory is leaked.
Run the attached example for 1-2 minutes with massif or a similar tool and you can see the following graph: