Java Set for the Heap Size

1.Find the Maximum heap size:
javaw -XX:+PrintFlagsFinal | find “MaxHeapSize”

2.Find the Initial heap size:
javaw -XX:+PrintFlagsFinal | find “InitialHeapSize”

3. Change the Heap size
@set JAVA_OPTS=-Xms256m -Xmx1g
OR
java -Xms (set initial Java heap size)
java -Xmx (set maximum Java heap size)
java -Xss (set java thread stack size)
Ex: java -Xms16m -Xmx64m

Add Comment