You can give the JVM an initial heap size with the -Xms parameter, and a maximum heap size with -Xmx. It will automatically grow up to the maximum size as needed.
Thanks for the reply Greg.
I was interested in knowing can a JVM grow its size beyond -Xmx size?
Also is there some doc which tells about the default values of these args. especially of -Xmx