Setting JVM Heap size at runtime

To set the JVM heap size, compile the program normally.
For example, consider Runtime.java program.
Compilation: javac Runtime.java
Now, to set minimum heap size(let, 16 MB) required by JVM, run the program as follows :
java -Xms16m Runtime 
We can also restrict maximum size(let 512 MB) utilized by JVM:
java -Xmx512m Runtime
 Both these options can also be combined to specify upper and lower bounds of JVM heap size:
java -Xms16m -Xmx512m Runtime
Now you can run a program that requires huge computational space.

0 comments:

Post a Comment

Popular Labels

Featured Post (TOP)

Flickr Images

Follow Me on Facebook.com

Follow on Google+

Recent Posts

AD (728x60)

Pages

Powered by Blogger.

Labels

Followers

Popular Posts

Popular Posts

Subscribe Via Email

Sign up for our newsletter, and well send you news and tutorials on web design, coding, business, and more! You'll also receive these great gifts: