I found the solution to my problem - it may help others ;) When I was increasing the heap size I was increasing the heap size of eclipse application, not of my program (which I executed through eclipse) What I had to do is modify the execution commands before running my program.