閱讀1019 返回首頁    go 阿裏雲 go 技術社區[雲棲]


JVM調優文獻參考

(1) https://www.oracle.com/technetwork/java/javase/tech/exactoptions-jsp-141536.html

(2) https://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

The options are loosely grouped into three categories.
Behavioral options change the basic behavior of the VM.
Performance tuning options are knobs which can be used to tune VM performance.
Debugging options generally enable tracing, printing, or output of VM information.

(3) https://www.oracle.com/technetwork/java/javase/trouble-138361.html

Contents of This Page
Troubleshooting Guides 
Quick Tips! 
Troubleshooting Tools 

Pertinent Articles 
Pertinent Blogs 
Pertinent Forum Sites 

(4) https://www.ibm.com/developerworks/cn/java/j-nativememory-linux/

(5) https://publib.boulder.ibm.com/infocenter/javasdk/tools/index.jsp?topic=/com.ibm.java.doc.igaa/_1vg00011e17d8ea-1163a087e6c-7ffe_1001.html

(6) https://www.securecoding.cert.org/confluence/display/java/The+CERT+Oracle+Secure+Coding+Standard+for+Java

(7) https://www.azulsystems.com/resources/presentations

(8) https://blogs.oracle.com/jonthecollector/entry/our_collectors

(9) https://www.bookonlinepdf.com/troubleshooting-and-diagnostic-guide-for-java-2-platform-standard-edition-5-0.pdf

(10) https://www.javaworld.com/javaworld/javatips/jw-javatip92.html

(12) https://www.ibm.com/developerworks/java/library/j-codetoheap/index.html

(13) https://www.oracle.com/technetwork/java/javase/tech/index-jsp-136373.html

(14 )https://java.sun.com/performance/reference/whitepapers/tuning.html

4. java.lang.StackOverflowError 5. out of memory in Native Code (C-heap)!


1.

[Full GC[PSYoungGen: 279700K->267300K(358400K)][ParOldGen: 685165K->685165K(685170K)]964865K->964865K(1043570K)  
[PSPermGen: 32390K->32390K(65536K)],0.2499342 secs]  
[Times: user=0.08 sys=0.00, real=0.05 secs]  
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space


2.


[Full GC[PSYoungGen: 0K->0K(141632K)][ParOldGen: 132538K->132538K(350208K)]32538K->32538K(491840K)  
[PSPermGen: 65536K->65536K(65536K)],0.2430136 secs]  
[Times: user=0.37 sys=0.00, real=0.24 secs]  
java.lang.OutOfMemoryError: PermGen space


Xmx6g -Xms6g -Xmn256m
-XX:PermSize=128m -XX:MaxPermSize=256m
-Xss256k
-XX:+DisableExplicitGC
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseFastAccessorMethods
-XX:+PrintCommandLineFlags



注意:UseParNewGC(ParNew+Serial Old),該選項實際上被後麵的並發標記GC(ParNew + CMS +Serial Old)選項覆蓋掉了~有些參數,尤其是帶radio或Threshold的,比方說MaxTenuringThreshold,InitialTenuringThreshold,InitialSurvivorRatio,MinSurvivorRatio, SurvivorRatio,MaxHeapFreeRatio,MinHeapFreeRatio,NewRatio,我們需要針對具體應用調優,記住,調優是件很伽利略的事情~


後記:在NIO使用場景比較多的情況下,-XX:+DisableExplicitGC可能會有副作用。如果擔心System.gc()調用造成fullGC頻繁,可以嚐試XX:+ExplicitGCInvokesConcurrent參數。在Full gc的時候會對old gen做reference processing,進而能觸發基於PhantomReference的清理對象Cleaner對已死的DirectByteBuffer對象做清理工作。


最近在研究JIT運行期性能優化,發現了JITWatch這個不錯的工具,記錄一下(關於JITWatch的更詳細的功能,可以參看這裏的視頻)。本來呢,通過hsdis插件獲得HotSpot執行時產生的匯編代碼也是一種不錯的選擇(如早期,我就喜歡這樣玩,java -server -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -XX:+DebugNonSafepoints DemoVolotile > demo.assembly),無奈如果希望全盤看懂那些匯編代碼還是有些夠嗆,畢竟自己那些匯編知識畢業後都還回去了,也沒有係統的拾起來過。

最後更新:2017-04-02 06:52:21

  上一篇:go 增強AW_Blog插件之後台文章編輯新增一圖片字段
  下一篇:go 更改Myeclipse默認的Jsp PageEncoding