In order to change the heap size, there are two parameters that need to be updated :
-Xms512m
-Xmx1024m
These parameters can be found in eclipse.ini file in the eclipse folder.
To change the stack size, there is a parameter that need to be updated :
-Xss512m