It is possible to increase the heap size allocated by the JVM by using command line options Here we have 3 options
-Xms<size> to set the initial Java heap size
-Xmx<size> to set the maximum Java heap size
-Xss<size> to set the java thread stack size
$ java -Xms1G -Xmx2G MainClass
In the above line, we have set the minimum heap size to 1GB and maximum heap size to 2GB.
Read more »
-Xms<size> to set the initial Java heap size
-Xmx<size> to set the maximum Java heap size
-Xss<size> to set the java thread stack size
$ java -Xms1G -Xmx2G MainClass
In the above line, we have set the minimum heap size to 1GB and maximum heap size to 2GB.
