• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java 1.7 Xmx defaults  RSS feed

 
Bill Clar
Ranch Hand
Posts: 163
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running an application on my Windows desktop under Java 1.7. I have 3.23 Gb of memory.

According to this site my default Xmx value should be "75% of total physical memory up to 1 GB". That's approximately 800 Mb, yet Runtime.maxMemory() turns up 247 Mb.

Either my math is wrong or I'm using the wrong chart for Xmx default values.

I'd prefer not to set a hard limit on Xmx as my users have varying levels of RAM.



 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to remove any doubt - can you confirm you are using the JRockit JVM ?
 
Bill Clar
Ranch Hand
Posts: 163
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how to confirm that. I'm using Oracle's JDK, 1.7.0_25.
 
Luan Cestari
Ranch Hand
Posts: 172
C++ Redhat Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THe problem is that you are expecting that JVM will allocate the XMX size, but it will only do that if it thinks is worth it. It also can free the memory when it is no longer needed. If you want to JVM use the XMX size, you should put the same value on XMS parameter (that is good to avoid internal malloc and free)
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill Clar wrote:I don't know how to confirm that. I'm using Oracle's JDK, 1.7.0_25.

Okay. It sounds like you are using the standard JVM and not JRockit, in which case that is the wrong chart.
Unfortunately I can't find any similar documentation for the standard JVM. This gives the values for a server-class machine using the Parallel garbage collector, but as you are on Windows it will be using the client JVM by default.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!