Jvm gc那点事

1,522 views

Published on

JVM GC算法简介

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,522
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
86
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Jvm gc那点事

    1. 1. JVM GC by
    2. 2. OutlineJVM 结 简Hotspot JVM GC 绍JVM GCLevit JVM
    3. 3. JVM Structure class files class loader Runtime Data Area NativeMethod Area Java Stack Method Stack Heap PC Register Execute Native Native Engine Interface Library
    4. 4. Heap Java new 对Method AreaJava Stack Java栈&Native Statck 栈
    5. 5. HotSpot JVM GCweak generational hypothesis: Most allocated objects are not referenced (considered live) for long, that is, they die young. Few references from older to younger objects exist.
    6. 6. HeapYoung Generation Eden From ToOld Generation Tenured Space
    7. 7. -Xmxn 间-Xmsn 间-Xmnn young-XX:PermSize=n 间
    8. 8. GCMinor GC young generation满 时 minor collectionFull GC old permanent满 时 进 full
    9. 9. GC VS 发VS Stop-the-World压缩 VS 压缩 VS 贝
    10. 10. GCEdenFrom To EmptyOld
    11. 11. GCEden Empty To From EmptyOld
    12. 12. Old GC marksweepcompact
    13. 13. GCClient 认-XX:+UseSerialGC
    14. 14. GCyoung Parallel Scavenage GCold Parallel MSC GC
    15. 15. Parallel Scavenge GC
    16. 16. Parallel Scavenge GCEdenFrom To
    17. 17. Parallel Scavenge GCEdenFrom To
    18. 18. Parallel Scavenge GCEdenFrom To
    19. 19. Parallel MSC GC
    20. 20. Parallel MSC GCR1: R2:4/6 R3:3/6 R4:1/6 R5:0/6
    21. 21. Parallel MSC GC destination region source regionR1: R2:4/6 R3:3/6 R4:1/6 R5:0/6 Dense prefix
    22. 22. Parallel MSC GCR1: R2:4/6 R3:3/6 R4:1/6 R5:0/6 T2 T1
    23. 23. Parallel MSC GCR1 R2 R3 R4 R5 T2 T1
    24. 24. Parallel MSC GCR1 R2 R3 R4 R5 T2 T1
    25. 25. GCServer 认-XX:+UseParallelGC
    26. 26. CMS GC
    27. 27. CMS GC
    28. 28. CMS 动 产
    29. 29. CMS-XX:+UseConcMarkSweepGC
    30. 30. GC F ir st r ba geGahttp://research.sun.com/jtech/pubs/04-g1-paper-ismm.pdf
    31. 31. GC组
    32. 32. JVMhttp://blogs.oracle.com/watt/resource/jvm-options-list.html
    33. 33. JVM GCjstatjmapjconsolejvisualvm
    34. 34. Levit JVM-Xmx2g 2G-Xms2g 2G-Xmn512m young 512M-XX:PermSize=128m Perm 128M-XX:MaxPermSize=196m Perm 196M-Xss256k 256K
    35. 35. Levit JVM-XX:+DisableExplicitGC GC System.gc() JVM GC-XX:+UseConcMarkSweepGC CMS GC-XX:+CMSParallelRemarkEnabled CMS remark remark -XX:+UseParNewGC-XX:+UseCMSCompactAtFullCollection:CMS Compact-XX:+UseFastAccessorMethods:Use optimized versions ofGet<Primitive>Field.-XX:+UseCMSInitiatingOccupancyOnly :Used to enabled/disable the use of theanticipated promotions to start a concurrent collection set-XX:+UseCompressedOops : 64 64 32Gb 32
    36. 36. GC
    37. 37. FullGC 应 频 启压 长 YoungGC
    38. 38. 资http://chaoticjava.com/posts/parallel-and-concurrent-garbage-collectorshttp://blogs.oracle.com/watt/resource/jvm-options-list.htmlhttp://www.oracle.com/technet work/java/javase/tech/index-jsp-136373.html
    39. 39. Any Questi ons Q&A

    ×