Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
java [2012/12/04 23:57]
a
java [2012/12/05 00:07]
a [Good/best practices]
Line 28: Line 28:
 | **-XX:MinHeapFreeRatio** | default is 40%. JVM will allocate memory to always have as minimum 40% of free memory. When -Xmx = -Xms, it's useless. | | **-XX:MinHeapFreeRatio** | default is 40%. JVM will allocate memory to always have as minimum 40% of free memory. When -Xmx = -Xms, it's useless. |
 | **-XX:MaxHeapFreeRatio:** | default is 70%. The same as Min, to avoid unecessary memory allocation. | | **-XX:MaxHeapFreeRatio:** | default is 70%. The same as Min, to avoid unecessary memory allocation. |
 +
 +
 +<note important>
 +**A nice gotcha...** \\
 +Major collection don't run until tenured is full.
 +This mean that using -Xmx1024, current heap could be 750MB with 500MB of "dead" object. If the JVM is idle, it could stay like that during a very long time => wasting 500MB or RAM for an idle JVM !
 +</note> 
  
 <note tip> <note tip>
Line 36: Line 43:
 ==== Good/best practices ==== ==== Good/best practices ====
  
 +FIXME
 ==== Examples ==== ==== Examples ====
  
 +tying to limit jvm to ~2G of RAM (java x86_64)
 +    java -Xms512m -Xmx2G -XX:+UseCompressedOops -server -XX:MaxPermSize128
 +    
 +java (i386)
 +    java -Xms1400m -Xmx2G -XX:MaxPermSize=128m -server
 ==== Troubleshooting ==== ==== Troubleshooting ====
  
java.txt ยท Last modified: 2012/12/07 12:29 by a
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready