JJUG JavaOne 2012 San Francisco 報告会 LT(G1GC)

3,780 views

Published on

JJUG JavaOne 2012 San Francisco 報告会, LT - G1GC のスライドです。

This Presentation Slide is the LT about G1GC at JJUG JavaOne 2012 San Francisco Briefing Meeting(Tokyo/Japan), 2012/11/9, Gree Inc.

0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,780
On SlideShare
0
From Embeds
0
Number of Embeds
1,456
Actions
Shares
0
Downloads
12
Comments
0
Likes
12
Embeds 0
No embeds

No notes for slide

JJUG JavaOne 2012 San Francisco 報告会 LT(G1GC)

  1. 1. JJUG JavaOne 2012 San Francisco 報告会(LT) G1GC チューニング と G1GC Visualizer ~ CON6583 – G1 Garbage Collector Performance Tuning より ~ 2012/11/9 木村英一(@kimuchi583) © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 1
  2. 2. 木村 英一 って、誰 ?武蔵小杉駅 横須賀線口の前に立つビルで Java案件支援, チューニング 諸々に対応してます。 Twitter : @kimuchi583 URL : http://kimuchi583.at.webry.info/ http://blog.kimu2.jp/本セッションの内容は、http://www.myexpospace.com/JavaOne2012/SessionFiles/CON6583_PDF_6583_0001.pdf © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 2
  3. 3. オプションは、これだけ !! ‐Xms6g ‐Xmx6g ‐XX:+UseG1GC‐XX:MaxGCPauseMillis=200 © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 3
  4. 4. これらのオプションはダメ !! ‐Xmn ‐XX:MaxNewSize ‐XX:NewSize ‐XX:NewRatio ‐XX:SurvivorRatioYoung 領域は目標達成のために自動的に調整される (ヒープ全体の20%~80%の範囲で) © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 4
  5. 5. Young 領域サイズを指定をすると … Young 領域のサイズを自動調整しない 一時停止時間の目標設定は無視する 私のほうが Java VM より 上手くチューニングできる !! 宣言 !! © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 5
  6. 6. G1GC の動作状況を分析するには ログ出力用 [‐verbosegc | ‐XLoggc:<gc.log>] ‐XX:+PrintGC ‐XX:+PrintGCTimeStamps ‐XX:+PrintGCDateStamps ‐XX:+PrintGCDetails ‐XX:+PrintAdaptiveSizePolicy ‐XX:+UnlockExperimentalVMOptions –XX:G1LogLevel=[fine | finer | finest] チューニング用 ‐XX:InitiatingHeapOccupancyPercent=<percent> ‐XX:G1OldCSetRegionLiveThresholdPercent=<percent> ‐XX:G1MixedGCCountTarget=<N> ‐XX:G1HeapWastePercent=<N> (http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html) © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 6
  7. 7. でも使えるのは、これだけ ログ出力用 [‐verbosegc | ‐XLoggc:<gc.log>] ‐XX:+PrintGC ‐XX:+PrintGCTimeStamps ‐XX:+PrintGCDateStamps ‐XX:+PrintGCDetails ‐XX:+PrintAdaptiveSizePolicy‐XX:+UnlockExperimentalVMOptions –XX:G1LogLevel=[fine | finer | finest] チューニング用 ‐XX:InitiatingHeapOccupancyPercent=<percent> ‐XX:G1OldCSetRegionLiveThresholdPercent=<percent> ‐XX:G1MixedGCCountTarget=<N> ‐XX:G1HeapWastePercent=<N>(http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html) © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 7
  8. 8. G1GC のサイクル Initial Mark – STWRoot Region Scanning – Concurrent Concurrent Marking – Concurrent Remark – STW Cleanup – STW + ConcurrentCopying(Young GC/Mixed GC) - STW 8 © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9
  9. 9. Mark Phase Copy phaseYoung mode Mark /Remark Phase Cleanup Phase Copy Phase 高 高 高 高 高 高 高 高 高Mixed mode 高 高 高 高 高 高 高 低 高 低 高 高 高 低 低 高 高 低 低 高 高 高 低 高 低 高 低 Non-Allocated Eden Survivor Old Recently copied in Survivor Recently copied in Old © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 9
  10. 10. こんな GC ログ、読むのは大変{Heap before GC invocations=0 (full 0): garbage-first heap total 16384K, used 5120K [0x03600000, 0x04600000, 0x05a00000) region size 1024K, 5 young (5120K), 0 survivors (0K) compacting perm gen total 12288K, used 6053K [0x05a00000, 0x06600000, 0x09a00000) the space 12288K, 49% used [0x05a00000, 0x05fe9478, 0x05fe9600, 0x06600000)No shared spaces configured.2012-08-22T16:37:32.445+0900: G1HR #StartGC 10.911: [GC pause (young)Desired survivor size 524288 bytes, new threshold 15 (max 15) 0.911: [G1Ergonomics (CSet Construction) start choosing CSet, predicted base time: 83.70 ms, remaining time: 116.30 ms, target pause time: 200.00 ms] 0.911: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 5 regions, survivors: 0 regions, predicted young region time: 127.33 ms] 0.911: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 5 regions, survivors: 0 regions, old: 0 regions, predicted pause time: 211.03 ms, targetpause time: 200.00 ms] G1HR CSET 0x03a00000: G1HR ALLOC(Survivor) 0x03b00000 G1HR ALLOC(Old) 0x03c00000 G1HR RETIRE 0x03c00000 0x03ccee20, 0.01186911 secs] [Parallel Time: 11.0 ms] [GC Worker Start (ms): 911.1 911.1 911.1 911.1 Avg: 911.1, Min: 911.1, Max: 911.1, Diff: 0.0] [Ext Root Scanning (ms): 2.6 3.5 3.6 4.6 Avg: 3.6, Min: 2.6, Max: 4.6, Diff: 2.0] [Update RS (ms): 0.0 0.1 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.1, Diff: 0.1] [Processed Buffers : 0 14 0 0 Sum: 14, Avg: 3, Min: 0, Max: 14, Diff: 14] [Scan RS (ms): 0.0 0.0 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Object Copy (ms): 8.2 7.0 7.0 6.0 Avg: 7.1, Min: 6.0, Max: 8.2, Diff: 2.2] [Termination (ms): 0.0 0.0 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Termination Attempts : 2 2 1 1 Sum: 6, Avg: 1, Min: 1, Max: 2, Diff: 1] [GC Worker End (ms): 921.9 921.9 921.9 921.9 Avg: 921.9, Min: 921.9, Max: 921.9, Diff: 0.0] [GC Worker (ms): 10.9 10.9 10.9 10.8 Avg: 10.9, Min: 10.8, Max: 10.9, Diff: 0.0] [GC Worker Other (ms): 0.2 0.3 0.3 0.3 Avg: 0.3, Min: 0.2, Max: 0.3, Diff: 0.2] [Clear CT: 0.1 ms] [Other: 0.7 ms] [Choose CSet: 0.0 ms] [Ref Proc: 0.5 ms] © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 10
  11. 11. そこで – JavaOne 2012 になかったネタ G1GC ログの可視化したい © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 11
  12. 12. 本セッションの内容は、 Fin.http://www.myexpospace.com/JavaOne2012/SessionFiles/CON6583_PDF_6583_0001.pdf © 2012 EIICHI KIMURA All Rights Reserved. 2012/11/9 12

×