top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

I want to change the Heap size of JVM. How can I achieve it?

+4 votes
339 views
I want to change the Heap size of JVM. How can I achieve it?
posted Sep 22, 2013 by Manish Negi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Old generation's default heap size can be overridden by using the -Xms and -Xmx switches to specify the initial and maximum sizes respectively:

java -Xms <initial size> -Xmx <maximum size> program

For example:

java -Xms64m -Xmx128m program
answer Sep 23, 2013 by Arvind Singh
...