Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Heap size for JVM 1.6

 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Can someone please let me know what is the default minimum and maximum heap size for JVM, if -Xms and –Xmx are not specified in Windows and Solaris environment?

I am using jre1.6 on Windows VISTA, XP environments

I am using jre1.6 on Solaris 10

Thanks,
Baiju S
 
Bob Wheeler
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I can give you code to get your default and max heap size:


I hope that helps a little bit and I hope that's correct lol.
cheers
Bob
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15359
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question does not have anything to do with the SCJP exam. I will move it to a more appropriate forum for you.
 
Ryan Anderson
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in case anyone wanted to change there heap size @ runtime....

http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html
 
Campbell Ritchie
Sheriff
Pie
Posts: 49396
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should find your ways round the official Java™ documentation: look for the java tool and also look for the "ergonomics" link. You see it appears to vary from computer to computer.
 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all for the update.

But, I am interested in knowing is there a default value for -Xmx. In other words, if we don't specify anything at runtime, does java has any default value?

Thanks
Baiju S
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes - 64MB. Which you could have found by searching.
 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Somehow, my search wasn't successful...

Baiju
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Yes - 64MB. Which you could have found by searching.


Actually, since Java 1.5, that's no longer true in all cases. See the ergonomics link that Campbell posted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic