Your SlideShare is downloading. ×
0
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
3장. Garbage Collection
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

3장. Garbage Collection

9,120

Published on

Java Performance Fundamental 세미나 교재입니다. 3장은 Garbage Collection에 대해 설명하고 있습니다. 먼저 JVM에서 사용하는 Garbage Collection 뿐만 아니라 일반적인 Garbage Collection의 Algorithm을 상세히 알아봅니다. 그 후 Hotspot JVM의 Heap구조와 Garbage …

Java Performance Fundamental 세미나 교재입니다. 3장은 Garbage Collection에 대해 설명하고 있습니다. 먼저 JVM에서 사용하는 Garbage Collection 뿐만 아니라 일반적인 Garbage Collection의 Algorithm을 상세히 알아봅니다. 그 후 Hotspot JVM의 Heap구조와 Garbage Collector를 설명하고 Generation별로 어떻게 동작하는 지에 대해 설명합니다. 이어 IBM JVM에 대한 Heap 구조와 Garbage Collector에 대해서도 설명합니다.

* Garbage Collection 이란?
* Garbage Collection 의 대상
* Garbage Collection 의 기본 Algorithm
* Hotspot JVM의 Garbage Collection
o Serial Collector
o Incremental Collector
o Parallel Collector
o CMS Collector
o Parallel Compaction Collector
o Garbage First Collector
* IBM JVM의 Garbage Collection
o Optimize for Throughput Collector
o Optimize for Pause Time Collector
o Generational Concurrent Collector
o Subpool Collector

Published in: Technology
1 Comment
21 Likes
Statistics
Notes
  • i want to ask you a quesiton about page P61 , the right picture i think may be object pool, you can see any object in the object pool has a pointer to the left one's index such A's pointer to the index 5,can you give some explanation of this pointer(in english ,my korea language is poor sorry)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
9,120
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
228
Comments
1
Likes
21
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Java Performance artdb@ex-em.com | performeister.tistory.com | twitter @novathinker Garbage Collection
    • 2. Java Performance 2 artdb@ex-em.com | performeister.tistory.com | twitter @novathinker 1) Garbage Collection 2) Garbage Collection Algorithm 3) Hotspot JVM Garbage Collection 4) IBM JVM Garbage Collection
    • 3. Java Performance 3 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection • Garbage Collection – Garbage Collector – Unreferenced Memory – – Fragmentation “Heap storage for objects is reclaimed by an automatic storage management system (typically a garbage collector); objects are never explicitly deallocated.” - Java Virtual Machine Speculation, Section 3.5.3 [JVMS2 1999]
    • 4. Java Performance 4 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ! Garbage Collector
    • 5. Java Performance 4 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ! object Garbage Collector Heap memory .
    • 6. Java Performance 4 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ! object Garbage Collector Heap memory . Garbage Collection Memory Recycling Heap Fragmentation .
    • 7. Java Performance 4 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ! object Garbage Collector Heap memory . Garbage Collection Memory Recycling Heap Fragmentation . • JVM heap new, newarray, anewarray, multianewarray instruction instruction • Garbage Collection • JVM Spec Garbage Collection Algorithm
    • 8. Java Performance 5 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ! Garbage Collector
    • 9. Java Performance 5 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Memory ! Memory System Garbage Collector crash .
    • 10. Java Performance 5 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Memory ! Memory System Garbage Collector crash . Program CPU Time Scheduling .
    • 11. Java Performance 6 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection • Garbage Collection – Garbage Collection
    • 12. Java Performance 7 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection
    • 13. Java Performance 7 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ROOT SET
    • 14. Java Performance 7 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ROOT SET Local Variable, Operand Stack
    • 15. Java Performance 7 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ROOT SET Local Variable, Operand Stack Class Constant Pool Reference
    • 16. Java Performance 7 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection ROOT SET Local Variable, Unreleased Native Operand Stack Method Object Reference Class Constant Pool Reference
    • 17. Java Performance 8 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Colletion • Root Set
    • 18. Java Performance 9 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Colletion • Memory Leak class Main{ public static void main (String args[]) { Leak lk = new Leak(); for(int a=0; a<9000000; a++) { lk.addList(a); lk.removeStr(a); } } } class Leak { ArrayList lst = new ArrayList(); public void addList(int a) { lst.add(" "+a); } public void removeStr(int i) { Object obj = lst.get(i); obj = null; } }
    • 19. Java Performance 9 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Colletion • Memory Leak class Main{ public static void main (String args[]) { Leak lk = new Leak(); for(int a=0; a<9000000; a++) { lk.addList(a); lk.removeStr(a); } } Why leak? } class Leak { ArrayList lst = new ArrayList(); public void addList(int a) { lst.add(" "+a); } public void removeStr(int i) { Object obj = lst.get(i); obj = null; } }
    • 20. Java Performance 10 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm
    • 21. Java Performance 11 artdb@ex-em.com | performeister.tistory.com | twitter @novathinker Garbage Collection Algorithm 1) Reference Counting Algorithm 2) Mark-and-Sweep Algorithm 3) Mark-and-Compacting Algorithm 4) Copying Algorithm 5) Generational Algorithm 6) Train Algorithm 7) Adaptive Algorithm
    • 22. Java Performance 12 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Garbage Collection Algorithm
    • 23. Java Performance 12 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Garbage Collection Algorithm Garbage Object Detection • Live Object : Root Set • Garbage Object
    • 24. Java Performance 12 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Garbage Collection Algorithm Garbage Object Detection • Live Object : Root Set • Garbage Object Garbage Object • Heap Memory Reclaim
    • 25. Java Performance 13 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Reference Counting Algorithm • Mark-and-Sweep Algorithm • Copying Algorithm • Mark-and-Compacting Algorithm • Generational Algorithm • Train Algorithm • Adaptive Algorithm
    • 26. Java Performance 14 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Reference Counting Algorithm – GC – Object Reference count – Reference Count 0 GC – Object GC Object Object Object Count Count
    • 27. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer RefCnt 00 Integer RefCnt 00 Integer RefCnt 00
    • 28. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); RefCnt 00 Integer RefCnt 00 Integer RefCnt 00
    • 29. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 RefCnt 01 0 Integer RefCnt 00 Integer RefCnt 00
    • 30. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; RefCnt 01 0 Integer RefCnt 00 Integer RefCnt 00
    • 31. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer RefCnt 00 Integer RefCnt 00
    • 32. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer Object a = new Ingeter(1); RefCnt 00 Integer RefCnt 00
    • 33. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer a 1 Object a = new Ingeter(1); 0 RefCnt 01 Integer RefCnt 00
    • 34. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer a 1 Object a = new Ingeter(1); 0 RefCnt 01 Object b = new Ingeter(2); Integer RefCnt 00
    • 35. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer a 1 Object a = new Ingeter(1); 0 RefCnt 01 Object b = new Ingeter(2); Integer 2 b RefCnt 01 0
    • 36. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer a 1 Object a = new Ingeter(1); 0 RefCnt 01 Object b = new Ingeter(2); Integer a = b; 2 b RefCnt 01 0
    • 37. Java Performance 15 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Integer Object a = new Ingeter(1); a 1 Object b = a; b RefCnt 01 0 2 Integer a 1 Object a = new Ingeter(1); 0 RefCnt 01 Object b = new Ingeter(2); Integer a = b; 2 b RefCnt 01 0 2
    • 38. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm
    • 39. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2));
    • 40. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2)); Integer 1 TwoInteger RefCnt 00 1 ref a RefCnt 00 1 Integer 2 RefCnt 01 0
    • 41. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2)); a = null; Integer 1 TwoInteger RefCnt 00 1 ref a RefCnt 00 1 Integer 2 RefCnt 01 0
    • 42. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2)); a = null; Integer 1 TwoInteger RefCnt 00 1 ref a RefCnt 00 1 Integer 2 RefCnt 01 0
    • 43. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2)); a = null; Integer 1 TwoInteger RefCnt 00 1 ref a GC RefCnt 00 1 Integer 2 RefCnt 01 0
    • 44. Java Performance 16 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Object a = new TwoIngeter(new Integer(1), new Integer(2)); a = null; Integer 1 RefCnt 00 1 a Integer 2 RefCnt 01 0 0
    • 45. Java Performance 17 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Reference Counting Algorithm • Garbage Object • Garbage • Garbage Collector ( ) • Reference Count • Linked List Reference Count 0 Leak
    • 46. Java Performance 18 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm a Linked List next ref RefCnt 02 Linked List next ref RefCnt 11 Linked List next ref RefCnt 01
    • 47. Java Performance 18 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm a Linked List next ref 2 RefCnt 01 Linked List next ref RefCnt 11 Linked List next ref RefCnt 01
    • 48. Java Performance 19 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Mark-and-Sweep Algorithm – Root Set Reference – Tracing Algorithm – Mark Sweep • Mark : Live Object Mark (Object flag or bitmap table ) • Sweep : Heap Mark
    • 49. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm R ref ref ref  flag  flag  flag ref ref ref  flag  flag  flag ref ref ref  flag  flag  flag
    • 50. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Mark Phase R ref ref ref  flag  flag  flag ref ref ref  flag  flag  flag ref ref ref  flag  flag  flag
    • 51. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Mark Phase R ref ref ref   flag   flag   flag ref ref ref  flag  flag   flag ref ref ref  flag   flag   flag
    • 52. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Sweep Phase R ref ref ref   flag   flag   flag ref ref ref  flag  flag   flag ref ref ref  flag   flag   flag
    • 53. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Sweep Phase R ref ref ref   flag   flag   flag ref   flag ref ref   flag   flag
    • 54. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm R ref ref ref   flag   flag   flag ref   flag ref ref   flag   flag
    • 55. Java Performance 20 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm R ref ref ref  flag  flag  flag ref  flag ref ref  flag  flag
    • 56. Java Performance 21 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Mark-and-Sweep Algorithm • Reference • Reference Overhead • Suspend • Fragmentation  Memory
    • 57. Java Performance 22 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Mark-and-Compacting Algorithm – Fragmentation Memory Algorithm – Mark Compaction • Mark Phase : Live Object Mark • Compaction : Live Object Memory – Handle • Mark Phase : Handle Marking • Compaction : Object Handle Update
    • 58. Java Performance 23 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Mark-and-Compacting Algorithm – Compaction Arbitrary Worst 4 1 2 3 1 2 3 4 Linear 1 3 4 2 • Arbitrary : Sliding • Linear : Pointer 1 2 3 4 • Sliding : Allocation Best
    • 59. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Handle 0  flag 1  flag T22 A 5 Z 1 2  flag T11 3  flag T12 B 9 W 7 4  flag 5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag 9  flag T32
    • 60. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Mark Phase Handle 0  flag 1  flag T22 A 5 Z 1 2  flag T11 3  flag T12 B 9 W 7 4  flag 5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag 9  flag T32
    • 61. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Mark Phase Handle 0  flag 1  flag T22 A 5 Z 1  2  flag T11 3  flag T12 B 9 W 7 4  flag  5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag  9  flag T32
    • 62. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Mark Phase Handle 0  flag 1  flag T22 A 5 Z 1  2  flag T11 3  flag T12 B 9 W 7 4  flag  5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag  9  flag T32
    • 63. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Mark Phase Handle 0  flag 1  flag T22 A 5 Z 1  2  flag T11 3  flag T12 B 9 W 7 4  flag  5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag  9  flag T32
    • 64. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Compation Phase Handle 0  flag 1  flag T22 A 5 Z 1  2  flag T11 3  flag T12 B 9 W 7 4  flag  5  flag T21 6  flag Q 3 C 2 7  flag T31 8  flag  9  flag T32
    • 65. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Compation Phase Handle 0  flag 1  flag T22 A 5  2  flag T11 3  flag T12 B 9 4  flag  5  flag T21 6  flag C 2 7  flag T31 8  flag  9  flag T32
    • 66. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Compation Phase Handle 0  flag 1  flag T22 A 5 B 9  2  flag T11 3  flag T12 4  flag  5  flag T12 T21 6  flag C 2 7  flag T31 8  flag  9  flag T32
    • 67. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Compation Phase Handle 0  flag 1  flag T22 A 5 B 9  2  flag T11 3  flag T12 C 2 4  flag  5  flag T12 T21 6  flag 7  flag T31 8  flag  9  flag T21 T32
    • 68. Java Performance 24 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm 2 Handle 0  flag 1  flag T22 A 5 B 9 2  flag T11 3  flag T12 C 2 4  flag 5  flag T12 T21 6  flag 7  flag T31 8  flag 9  flag T21 T32
    • 69. Java Performance 25 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Mark-and-Compacting Algorithm • Fragmentation • Memory • Reference Object Access Overhead • Suspend
    • 70. Java Performance 26 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Copying Algorithm – Stop-the-Copy Algorithm – Heap Active Inactive – Active Object – Active Live Object Inactive Copy
    • 71. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Active Area A C B R Inactive Area
    • 72. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Active Area A C null null B null R Inactive Area
    • 73. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Active Area A C null B null R A’ null Inactive Area
    • 74. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Active Area A C null B R A’ B’ null null Inactive Area
    • 75. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Active Area A C B R A’ B’ C’ null null null Inactive Area
    • 76. Java Performance 27 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Inactive Area R A’ B’ C’ null null null Active Area
    • 77. Java Performance 28 Java Performance Fundamental | twitter @novathinker Garbage Collection Algorithm artdb@ex-em.com | performeister.tistory.com • Copying Algorithm • Fragmentation  Inactive Copy • GC Suspend • Copy Overhead •
    • 78. Java Performance 29 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Generational Algorithm – Copying Algorithm • Copy • Object • Object • Long Lived Object – Heap age sub heap Youngest Generation Sub heap GC – Object Age
    • 79. Java Performance 30 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Youngest Generation Sub Heap Matured Live Live Dead Dead Live Matured Dead Live Dead Dead Live Dead Dead Matured Tenured Generation Sub Heap
    • 80. Java Performance 30 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Youngest Generation Sub Heap Live Live Dead Dead Live Dead Live Dead Dead Live Dead Dead Tenured Generation Sub Heap GC Matured Matured Matured
    • 81. Java Performance 30 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Youngest Generation Sub Heap Live Live Live Live Live Tenured Generation Sub Heap GC Matured Matured Matured
    • 82. Java Performance 30 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Youngest Generation Sub Heap Matured Matured Dead Live Matured Dead Live Matured Live Tenured Generation Sub Heap Matured Matured Matured
    • 83. Java Performance 31 Java Performance Fundamental | twitter @novathinker Garbage Collection Algorithm artdb@ex-em.com | performeister.tistory.com • Generational Algorithm • Sub Heap Mark-and-Sweep Copying Algorithm Fragmentation, Memory , Copy • JVM
    • 84. Java Performance 32 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Train Algorithm – Incremental Algorithm – Memory Mark-and-Copy GC – GC Suspend Idea
    • 85. Java Performance 33 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Train Algorithm Car : Memory Block , Fixed Size RememberSet RememberSet Car root A B C A’ B’ C’ set Train : Car( ) Car
    • 86. Java Performance 34 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Car 1-1 Car 1-2 Train 1 {R1,E} A B C D E F R1 Car 2-1 Train 2 {R2,B} R2 G
    • 87. Java Performance 34 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Free Car Car 1-1 Car 1-2 Train 1 {C} D E F C R1 Car 2-1 Train 2 {R2,B} R2 G Car 3-1 Train 3 {R1} A B
    • 88. Java Performance 34 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm Free Car Free Car Free Car Free Train R1 Car 2-1 Train 2 {R2,B} R2 G Car 3-1 Train 3 {R1} A B
    • 89. Java Performance 35 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Train Algorithm • Suspend • Suspend • Fragmentation
    • 90. Java Performance 36 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Garbage Collection Algorithm • Adaptive Algorithm – Algorithm Trade Off  Algorithm – Adaptive Algorithm Algorithm – Heap Algorithm – Hotspot Ergonomic , IBM Tilt – Application
    • 91. Java Performance artdb@ex-em.com | performeister.tistory.com | twitter @novathinker Hotspot JVM
    • 92. Java Performance 38 artdb@ex-em.com | performeister.tistory.com | twitter @novathinker Hotspot JVM Garbage Collection 1) Garbage Collection of Hotspot JVM 2) Heap of Hotspot JVM 3) Garbage Collector 4) Serial Collector 5) Incremental Collector 6) Parallel Collector 7) Parallel Compacting Collector 8) CMS Collector 9) Garbage First Collector
    • 93. Java Performance 39 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collection of Hotspot JVM – Weak Generational Hypothesis • High Infant Mortality • Few References from Older to Younger Objects Exists – Young Generation GC Algorithm • Speed – Fast Allocation & TLAB – Old Generation GC Algorithm • – Card Table & Write Barrier
    • 94. Java Performance 40 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Fast Allocation & TLAB T T T T T Synchronization 1 2 3 4 5 Wait Allocation T T T T T 1 2 3 4 5 TLAB Allocation Allocation Allocation Allocation Allocation
    • 95. Java Performance 41 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Fast Allocation & TLAB – Memory – Bump-the-Pointer – Multi Thread – Hotspot JVM TLAB (Thread Local Allocation Buffer) • Thread • TLAB • Allocation code – 10 native instructions
    • 96. Java Performance 42 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Card Table Write Barrier – 1 Byte Card / 512 Byte of Old Generation – Old to Young Reference – Write Barrier • Bytecode Interpreter • 2 native instructions Young Generation Old Generation Card Table
    • 97. Java Performance 43 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collection of Hotspot JVM – Garbage Collection • Minor Collection : Young Generation • Major Collection : Old Generation – Full Collection – Method Area GC Major Full
    • 98. Java Performance 44 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Heap of Hotspot JVM Survivor 1 Survivor 2 Eden Tenured Permanent Young Generation Old Generation Method Area GC
    • 99. Java Performance 45 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • JVM Option – Standard Option : JVM Option :- – Non-Standard Option • JVM • , Parameter • -X Option : Macro • -XX Option : Micro
    • 100. Java Performance 46 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Automatic Selection – Java5 Garbage Collector, Heap Size – Hardware Resource OS – Sever Class Client Class
    • 101. Java Performance 47 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Automatic Selection – Server Class • :2 CPU, 2GB Physical Mem. • 32bit Windows • Default Garbage Collector Parallel Collector • Initial Heap Size – 1GB 1/64 * Physical Memory – 1GB 32MB • Max Heap Size : 1GB ¼ * Physical Mem. • Server Runtime Compiler
    • 102. Java Performance 48 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Automatic Selection – Client Class • Server Class • Default Garbage Collector Serial Collector • Initial Heap Size : 4MB • Max Heap Size : 64MB • Client Runtime Compiler
    • 103. Java Performance 49 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Automatic Selection – Option • -server : Server Class • -client : Client Class
    • 104. Java Performance 50 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – Serial Collector • Hotspot JVM Default Garbage Collector • Default Collector • Young Generation : Generational Algorithm • Old Generation : Mark-and-Compacting Algorithm
    • 105. Java Performance 51 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – Parallel Collector • (Throughput) Garbage Collector • Throughput Garbage Collector • Young Generation • Young Generation : Parallel Copy Algorithm • Old Generation : Mark-and-Compacting Algorithm
    • 106. Java Performance 52 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – Parallel Compacting Collector • Parallel Collector Old Generation • Java SE 5.0 update 6 • Young Generation : Parallel Copy Algorithm • Old Generation : Parallel Compacting Algorithm
    • 107. Java Performance 53 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – CMS Collector • CMS : Concurrent Mark-Sweep • • Old Generation Pause Time (Low Pause Garbage Collector) • Young Generation : Parallel Copy Algorithm • Old Generation : Concurrent Mark-and- Sweep Algorithm
    • 108. Java Performance 54 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – Incremental Collector • Low Pause Garbage Collector • Train Collector • Young Generation : Generational Algorithm • Old Generation : Train Algorithm
    • 109. Java Performance 55 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector – Garbage First Collector • Java SE 6 Update 14 • Train Algorithm • Generation • Heap Region Young , Old Area • Realtime Low Pause
    • 110. Java Performance 56 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Young, Old Generation Serial (Single CPU Use) – Suspend during Collecting – Client Class Collector –
    • 111. Java Performance 57 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Young Generation Collection : Generational Young Eden A Survivor1 - From Survivor2 - To B C Empty Old
    • 112. Java Performance 57 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Young Generation Collection : Generational Minor GC Young Eden A Survivor1 - From Survivor2 - To B C A’ B’ C’ Old
    • 113. Java Performance 57 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Young Generation Collection : Generational Young Eden Empty Survivor1 - From Survivor2 - To Empty A’ B’ C’ Old
    • 114. Java Performance 58 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector Young Eden A Survivor1 - To Survivor2 - From Empty B M Old
    • 115. Java Performance 58 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector Minor GC Young Eden Empty Survivor1 - To Survivor2 - From A’ B’ Empty Old M’
    • 116. Java Performance 59 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Old Generation Collection : Mark-and-Compacting Old
    • 117. Java Performance 59 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Old Generation Collection : Mark-and-Compacting Mark Old √ √ √
    • 118. Java Performance 59 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Old Generation Collection : Mark-and-Compacting Sweep Old √ √ √
    • 119. Java Performance 59 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – Old Generation Collection : Mark-and-Compacting Sliding Compaction Old √ √ √ Sliding Compaction : Fragmentation
    • 120. Java Performance 60 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Serial Collector – JVM Option • -XX:+UseSerialGC : J2SE5.0, update 6 Serial Collector • -XX:MaxTenuringThreshold=<value> : Aging , default 31 • -XX:PretenureSizeThreshold=<value> : Old Generation directly Allocation • -XX:+PrintTenuringDistribution : Promotion
    • 121. Java Performance 61 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Memory, Multi-CPU – GC Multi Thread – Large Young Generation – Server Class Default Garbage Collector (CPU 1 ) – Old Generation Collection : Serial Collector
    • 122. Java Performance 62 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Young Generation Collection : Parallel Copy Serial Collector Parallel Collector Stop & Copy
    • 123. Java Performance 62 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Young Generation Collection : Parallel Copy Serial Collector Parallel Collector Stop & Copy
    • 124. Java Performance 62 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Young Generation Collection : Parallel Copy Serial Collector Parallel Collector Stop & Copy
    • 125. Java Performance 63 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Promotion Buffer • Parallel Local Allocation Buffer(PLAB) • Thread • Promotion Thread Promotion Buffer • Fragmentation – GC Thread – Old Generation Size
    • 126. Java Performance 64 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Promotion Buffer T1 T2 T1 T2 Promotion Buffer
    • 127. Java Performance 65 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Option • -XX:+UseParallelGC : Parallel Collector (CMS Collector ) • -XX:ParallelGCThreads=<value> : GC Thread default CPU
    • 128. Java Performance 66 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector – Ergonomics Option • -XX:MaxGCPauseMills=<value> (1.5+) : Maximum Pause Time Goal Pause Time • -XX:GCTimeRatio=<value> (1.5+) : Throughput Goal , default 1% GC Time • -XX:+UseAdaptiveSizePolicy (1.4.1+) : Young/Old Sizing
    • 129. Java Performance 67 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector • -XX:YoungGenerationSizeIncrement=<value> : Young Growing Percent, Default = 20 (1.5+) •- XX:TenuredGenerationSizeIncrement=<value> : Old Growing Percent, Default = 20 (1.5+) •- XX:AdaptiveSizeDecrementScaleFactor=<value > : Growing Shrink , Default = 4 (1.5+) • -XX:+AggressiveHeap : Physical Memory Max Heap Hardware Resource
    • 130. Java Performance 68 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Collector • -XX:GCHeapFreeLimit=<value> (1.4.1+) : GC Free Space Heap (default 5) -XX:+UseParallelGC GC OOME • -XX:GCTimeLimit=<value> (1.4.1+) : GC (default 90) -XX:+UseParallelGC GC OOME
    • 131. Java Performance 69 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Parallel Collector Old Generation Collection Algorithm – Parallel Collector – Multi CPU – Old Generation Collection – Young Generation Collection • Parallel Collector • Parallel Copy Algorithm
    • 132. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 133. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 134. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 135. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 136. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 137. Java Performance 70 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Old Generation Collection : Parallel Compaction Parallel Compacting Collector Mark Phase Summary Phase Compaction Phase
    • 138. Java Performance 71 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Mark Phase • Generation Region • Live Object Marking • Parallel Work
    • 139. Java Performance 71 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Mark Phase • Generation Region • Live Object Marking • Parallel Work       
    • 140. Java Performance 72 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Summary Phase • Region Operation • Single Work • Density • Dense Prefix • Dense Prefix GC       
    • 141. Java Performance 72 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Summary Phase • Region Operation • Single Work • Density • Dense Prefix • Dense Prefix GC        Dense Prefix
    • 142. Java Performance 72 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Summary Phase • Region Operation • Single Work • Density • Dense Prefix • Dense Prefix GC        Dense Prefix
    • 143. Java Performance 73 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Compaction Phase • Thread Region Collecting • Source, Destination • Live Object Destination Compaction       
    • 144. Java Performance 73 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Compaction Phase • Thread Region Collecting • Source, Destination • Live Object Destination Compaction Destination Source       
    • 145. Java Performance 73 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Compaction Phase • Thread Region Collecting • Source, Destination • Live Object Destination Compaction Destination Source        T1 T2
    • 146. Java Performance 73 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Compaction Phase • Thread Region Collecting • Source, Destination • Live Object Destination Compaction Destination Source        T1
    • 147. Java Performance 73 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Compaction Phase • Thread Region Collecting • Source, Destination • Live Object Destination Compaction       
    • 148. Java Performance 74 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Parallel Compacting Collector – Option • -XX:+UseParallelOldGC (+Java6) : Parallel Compaction Collector • -XX:+UseParallelOldGCCompacting (+Java6) : Parallel Compaction , Default True • -XX:+UseParallelDensePrefixUpdate (+Java6) : Dense Prefix , Default True
    • 149. Java Performance 75 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Fast Elapsed Time – Old Generation – Low Latency Collector – – GC Pause Time – Young Generation Collection • Parallel Collector
    • 150. Java Performance 76 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection : Concurrent Mark-Sweep Concurrent Mark-Sweep Collector
    • 151. Java Performance 76 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection : Concurrent Mark-Sweep Concurrent Mark-Sweep Collector Initial Mark Phase
    • 152. Java Performance 76 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection : Concurrent Mark-Sweep Concurrent Mark-Sweep Collector Initial Mark Phase Concurrent Mark Phase
    • 153. Java Performance 76 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection : Concurrent Mark-Sweep Concurrent Mark-Sweep Collector Initial Mark Phase Concurrent Mark Phase Remark Phase
    • 154. Java Performance 76 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection : Concurrent Mark-Sweep Concurrent Mark-Sweep Collector Initial Mark Phase Concurrent Mark Phase Remark Phase Concurrent Sweep Phase
    • 155. Java Performance 77 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection • Initial Mark Phase – Serial Phase – Direct Referenced Object • Concurrent Mark Phase – Serial Phase – Application – Direct Reference Object
    • 156. Java Performance 78 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Old Generation Collection • Remark Phase – Parallel Phase – Marking Mark • Concurrent Sweep Phase – Serial Phase – Dead Object Reclaim – Compaction
    • 157. Java Performance 79 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – No Compaction!!! • , But Free Space  FreeList • Fast Allocation : Promotion Young     
    • 158. Java Performance 79 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – No Compaction!!! • , But Free Space  FreeList • Fast Allocation : Promotion Young
    • 159. Java Performance 80 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector • Fragmentation  Object Size Tracking,  Free Block
    • 160. Java Performance 81 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Concurrent Mark Allocation – Floating Garbage • Concurrent Mark Garbage • Next GC • Memory
    • 161. Java Performance 82 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Floating Garbage
    • 162. Java Performance 83 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Scheduling Collection • Old Generation Full • Old Generation Full GC • Minor GC Remark Minor GC • Current Heap • : Heap 68%
    • 163. Java Performance 84 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Option • -XX:+UseConcMarkSweepGC (1.4.0+) : CMS Collector (+XX:UseParallelGC ) • -XX:+UseParNewGC (1.4.1+) : Young Parallel Option • -XX:CMSInitiatingOccupancyFraction (1.4.1+) : Current Old Generation
    • 164. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase
    • 165. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase Initial Mark Phase
    • 166. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase Initial Mark Phase Concurrent Mark Phase
    • 167. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase Initial Mark Phase Concurrent Mark Phase Remark Phase
    • 168. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase Initial Mark Phase Concurrent Mark Phase Remark Phase Concurrent Sweep Phase
    • 169. Java Performance 85 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Concurrent phase • Concurrent Phase Initial Mark Phase CPU Concurrent Mark Phase GC Remark Phase Concurrent Sweep Phase
    • 170. Java Performance 86 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Incremental Mode • Minor GC Concurrent Phase • Duty Cycle Concurrent Collector • Duty Cycle –1 CPU – Minor GC – I-CMS ( ) or
    • 171. Java Performance 87 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector – Option • -XX:+CMSIncrementalMode (1.4.2+) : Incremental Mode (default False) CMS CMSInitiatingOccpancyFraction • -XX:+CMSIncrementalPacing (1.4.2+) : Duty Cycle (default False)
    • 172. Java Performance 88 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector • -XX:CMSIncrementalDutyCycle=<value> (1.4.2+) : Duty Cycle (default 50) Minor GC (0~100) 50 • -XX:CMSIncrementalDutyCycleMin=<value> : Duty Cycle (0~100) (Default 10) (1.4.2+)
    • 173. Java Performance 89 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector •- XX:CMSIncrementalSafetyFactor=<value>(1.4.2 +) : Duty Cycle (Default 10) • -XX:CMSIncrementalOffset=<value> (1.4.2+) : Duty Cycle Minor GC (0~100) (Default 0)
    • 174. Java Performance 90 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • CMS Collector • -XX:CMSExpAvgFactor=<value> (1.4.2+) : % (Default 25) (0~100)
    • 175. Java Performance 91 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Incremental Collector – Train Collector – Old Generation Pause Time – Young Generation Collection : Stop-the- Copy – Old Generation Collection : Train • Old small GC • OOME Mark-and-Compaction – Old Fragmentation
    • 176. Java Performance 92 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Incremental Collector
    • 177. Java Performance 93 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Incremental Collector – Minor GC • Minor GC Major GC (overhead) • Minor GC Old GC • Throughput Default collector • Pause Time
    • 178. Java Performance 94 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Incremental Collector – Collector – Option • -Xincgc : Incremental GC : -XX:+UseParallelGC, -XX:+UseParNewGC
    • 179. Java Performance 95 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage Collector Garbage Young Generation Old Generation Option Collector Collection Algorithm Collection Algorithm Serial Collector -XX:+UseSerialGC Generational Mark-and-Compacting (Default Collector) Parallel Collector -XX:+UseParallelGC Parallel Copy Mark-and-Compacting Parallel Compacting -XX:+UseParallelOldGC Parallel Copy Parallel Compacting Collector -XX: Concurrent CMS Collector +UseConcMarkSweepG Parallel Copy C Mark-Sweep Incremental -Xincgc Generational Train Collector
    • 180. Java Performance 96 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Option • -XX:+DisableExplicitGC : System.gc() • -XX:+PrintGC • -XX:+PrintGCDetails • -XX:+PrintGCTimeStamps • -XX:+PrintHeapAtGC • -Xloggc:<file> • -verbosegc
    • 181. Java Performance 97 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Java SE 6 update 14 – Realtime • Y ms interval x ms GC – Single Generation • Generation • Heap region – 1MB Best Region • Young Generation : a Set of Regions – Allocation Region Young Generation • Old Generation : a Set of Regions
    • 182. Java Performance 98 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First • Concurrent Marker Heap Region live data • Live Data Garbage Region • Garbage Region
    • 183. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection
    • 184. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection
    • 185. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause)
    • 186. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause) Concurrent Mark - Marking
    • 187. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause) Concurrent Mark - Marking Concurrent Mark - Remarking
    • 188. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause) Concurrent Mark - Marking Concurrent Mark - Remarking Old Region Reclaim - Remark
    • 189. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause) Concurrent Mark - Marking Concurrent Mark - Remarking Old Region Reclaim - Remark Old Region Reclaim – Evacuation Pause
    • 190. Java Performance 99 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection Young GC (Evacuation Pause) Concurrent Mark - Marking Concurrent Mark - Remarking Old Region Reclaim - Remark Old Region Reclaim – Evacuation Pause Compaction
    • 191. Java Performance 100 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Young GC (Evacuation Pause) – Live Object Survivor Region Old Region – Stop-the-Copy – Parallel
    • 192. Java Performance 100 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Young GC (Evacuation Pause) – Live Object Survivor Region Old Region – Stop-the-Copy – Parallel
    • 193. Java Performance 100 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Young GC (Evacuation Pause) – Live Object Survivor Region Old Region – Stop-the-Copy – Parallel
    • 194. Java Performance 101 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Concurrent Marking – Mark : Evacuation Pause Initial Mark – Remark : Region Live Empty Region reclaim Stop the World
    • 195. Java Performance 101 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Concurrent Marking – Mark : Evacuation Pause Initial Mark – Remark : Region Live Empty Region reclaim Stop the World
    • 196. Java Performance 102 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Reclaim Old Region – Live Object Region – old Region collected
    • 197. Java Performance 102 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Reclaim Old Region – Live Object Region – old Region collected
    • 198. Java Performance 103 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Garbage First Collection • Compaction – Large chunk Free Space – Fragmentation – Fast Allocation » Free List » Linear » TLAB – - Copy Pause Time
    • 199. Java Performance 104 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com Hotspot JVM • Garbage First Collector – Options • -XX:+UnlockExperimentalVMOptions • -XX:+UseG1GC
    • 200. Java Performance artdb@ex-em.com | performeister.tistory.com | twitter @novathinker IBM JVM
    • 201. Java Performance 106 artdb@ex-em.com | performeister.tistory.com | twitter @novathinker IBM JVM Garbage Collection 1) Heap of IBM JVM 2) Heap Expansion Shrink 3) Garbage Collector 4) Optimize for Throughput 5) Optimize for Pause Time 6) Generation Concurrent 7) Subpooling
    • 202. Java Performance 107 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout – 1.4 Heap – Single Space heapbase heaplimit heaptop • Heap • Heapbase : Heap • Heaplimit : (movable) • Heaptop : Heap
    • 203. Java Performance 108 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout – 1.4 Heap heapbase heaplimit heaptop Heap K Cluster P Cluster Wilderness Heap cache or LOA
    • 204. Java Performance 109 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout • Kcluster : Pinned Class Object – Default 1280 class entries – 1 Class Entry 300byte(32it), 560byte(64bit) • Pcluster : Pinned Object • Kcluster Pcluster • Pcluster 2KB Pcluster • Pcluster
    • 205. Java Performance 110 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout – Large Object Area • Large Object • 64KB Object • Heap • -Xloratio LOA (0.5 ~ 0.95 ) • Java5 -Xloainitial (default 0.05, 5%), - Xloamaximum(default 0.5, 50%) • 1MB Object
    • 206. Java Performance 111 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout Garbage Object Live Object
    • 207. Java Performance 112 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout - Subpool – Free Chunk FreeList – -Xgcpolicy: subpool – Pool FreeList, CPU Pool 1 Small Size Freelist Middle Size Freelist 2 3 4 5 … Large Size Freelist n
    • 208. Java Performance 113 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Layout – Java 5 Heap – Heap Generational Heap – -Xgcpolicy: gencon Allocation Space Survivor Space Tenured Space Nursery Tenured
    • 209. Java Performance 114 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Allocation – Heap Lock • 512byte Object • Heap Lock Free List • GC • Free Chunk Heap Lock – Dark Matter • Free Chunk 512 byte Freelist • Dark Matter compaction
    • 210. Java Performance 115 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Heap Options • -Xmx<value> , -Xms<value> • -Xmaxf<percentage> : Free Space (default 0.6, 60%) • -Xminf<percentage> : Free Space (default 0.3, 30%) • -Xloa :loa , subpool default • -Xmaxe<size> heap expansion (default 0)
    • 211. Java Performance 116 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Heap Options • -Xk<classes> (~1.4.2) – Kcluster – class – Class 1.1~1.15 • -Xp<initial>,<overflow> (~1.4.2) – Pcluster – initial Size OverFlow
    • 212. Java Performance 117 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Expansion Shrink – Expansion • Expansion · Garbage Collector Allocation · Free Space –Xminf · GC –Xmaxt
    • 213. Java Performance 118 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Expansion Shrink – Expansion • Expansion · Free Space -Xmaxf –Xmaxf · –Xmaxe –Xmaxe · –Xmine –Xmine · Expansion 32bit 512byte 64bit 1024byte
    • 214. Java Performance 119 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Expansion Shrink – Shrink • Shrink · Garbage Collection · -Xmaxf 100% · System.gc() free space –Xminf · Heap 3 GC • free space –Xmaxf Shrink
    • 215. Java Performance 120 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Heap Expansion Shrink – Shrink • Shrink – -Xmaxf –Xms – 32bit 512byte 64bit 1024byte
    • 216. Java Performance 121 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Heap Size Options • -Xmaxf<percentage> : Free Space (default 0.6, 60%) • -Xminf<percentage> : Free Space (default 0.3, 30%) • -Xmaxe<size> heap expansion (default 0) • -Xmine<size> heap expansion (default 1MB) • -Xmaxt<percentage>
    • 217. Java Performance 122 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Garbage Collection Options • -Xgcpolicy:<optthruput | optavgpause | gencon | subpool> : Garbage Collector • -Xdisableexplicitgc : System.gc() • -Xverbosegclog:<path to file>[X,Y] : file gc log : X,Y integer X file , Y GC Cycle • -verbose:gc : gc
    • 218. Java Performance 123 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Garbage Collection Options • -Xcompactexplicitgc – System.gc() Compaction (default) • -Xnocompactexplicitgc – System.gc() Compaction • -Xcompactgc – GC Compaction (default) • -Xnocompacgc – GC Compaction
    • 219. Java Performance 124 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Heap – Garbage Collection Options • -Xcompactexplicitgc – System.gc() Compaction (default) • -Xnocompactexplicitgc – System.gc() Compaction • -Xcompactgc – GC Compaction (default) • -Xnocompacgc – GC Compaction
    • 220. Java Performance 125 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Garbage Collector – -Xgcpolicy – Optimize for throughput (optthruput) • Default garbage collector • – Optimize for pause time (optavgpause) • Concurrent GC • GC pause time •
    • 221. Java Performance 126 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • IBM JVM Garbage Collector – Generational Concurrent (gencon) • Object • Generational Heap – Subpooling (subpool) • Default algorithm • 16 CPU SMP
    • 222. Java Performance 127 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Collector Algorithm Mark Phase Sweep Phase Compaction Phase 1.4 - Incremental optthruput Parallel Mark Parallel bitwise Sweep Compaction, 5.0–Parallel Compaction 1.4-Parallel bitwise 1.4 - Incremental Sweep, Compaction, optavgpause Concurrent Mark 5.0-Concurrent 5.0-Mostly Concurrent Sweep Compaction Scavenge Copy of New Area Global Collection of Old Area gencon Mostly Concurrent Concurrent Mark Parallel bitwise Sweep Compaction 1.4 - Incremental subpool Parallel Mark Parallel bitwise Sweep Compaction, 5.0–Parallel Compaction
    • 223. Java Performance 128 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Application – Default Garbage Collector – Parallel Algorithm – GC Application Suspend – Mark-Sweep phase GC Cycle – Compaction Fragmentation AF • Allocation Failure(AF) :
    • 224. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction
    • 225. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction
    • 226. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction Mark Phase  
    • 227. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction
    • 228. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction
    • 229. Java Performance 129 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput – Mark-Sweep & Compaction
    • 230. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread
    • 231. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread
    • 232. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread Mark
    • 233. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread Mark Sweep
    • 234. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread Mark Sweep
    • 235. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread Mark Sweep Compaction
    • 236. Java Performance 130 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – GC Thread Mark Sweep Compaction
    • 237. Java Performance 131 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • 1.4 : Mark Stack • Java 5 : Work Packet – Sweep Phase : Parallel Bitwise Sweep – Compaction Phase • 1.4 : Incremental Compaction • Java 5 : Parallel Compaction
    • 238. Java Performance 132 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • Tracing Live Object Mark • Live Object – Register, stack, static, jni Object – Move dosed bit on – Mark bit – Mark Stack – Mptr class object mark – Array array entry trace
    • 239. Java Performance 133 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • Mark Stack (1.4) – Trace Live Object reference – Marking Thread 4KB Mark Stack – Marking Thread thread Stack scan reference push, mark bit – Garbage Collector Pop Object Mark – Array Array Entry Mark – MSO(Mark Stack Overflow) » Object NotYetScanned bit Global Flag » Object » Thread » Heap
    • 240. Java Performance 134 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • Work Packet(5.0) – Java5 Work Packet Pool – Work Packet Mark Stack – Marking Thread 2 Work Packet » Input Packet : reference pop » Output Packet : Unmarked Object Push » Reference Output Packet Push Mark
    • 241. Java Performance 135 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • Work Packet(5.0) – Root Object mark bit reference output packet – Root Object Reference input Packet Pop Object – List
    • 242. Java Performance 136 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Mark Phase : Parallel Mark • Parallel Mark(1.4) – Mark – application Thread master gc thread helper thread – Helper Thread 4KB Mark Stack Shareable Queue 2KB Mark Queue • Parallel Mark(5.0) – helper Thread Work Packet Pool
    • 243. Java Performance 137 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Sweep Phase : Parallel Bitwise Sweep • Alloc bits Mark Bits Reference Allocated Object • Bit Wised Technique – Mark bits 0 Free Space – 512 byte freelist • Sweep mark bits alloc bits
    • 244. Java Performance 138 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com IBM JVM • Optimize for throughput Garbage Object Live Object
    • 245. Java Performance 139 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Sweep Phase : Parallel Bitwise Sweep • Parallel Bit-wised Sweep – Sweep – Heap N Section » 1.4 : N Helper Thread *32, heap size / 16MB » 5.0 : N heap size / 256KB, 256KB fixed Size – Helper Thread Section Scan & Sweep – Section Free List
    • 246. Java Performance 140 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Compaction – GC – Sweep Allocation Request – System.gc() AF Compaction – TLH TLH 1000Byte(1.4) 1024Byte(5.0) – Free Space Active heap 5% 128MB
    • 247. Java Performance 141 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • 1.4 Compaction – Unmovable Object – Incremental Compaction Algorithm • 5.0 Compaction – Parallel Compaction – Unmovable Object
    • 248. Java Performance 142 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Incremental Compaction(1.4) – Compaction Compaction – 128MB Heap – Heap Section Section Compaction – 1.4.2 Default – Mark Phase Section Free Space – Object , , Pointer – Section GC
    • 249. Java Performance 143 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – UnMovable Object (~1.4.2) • Dosed Object – Stack(Local Variable, Method Parameter) Object – Dosed bit on, • Pinned Object – JNI, Class Object, Other Pinned Object – Pinned bit On,
    • 250. Java Performance 144 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – UnMovable Object pinned dosed Compaction pinned dosed
    • 251. Java Performance 145 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Incremental Compaction(1.4) Dark Matter One Section per Thread
    • 252. Java Performance 146 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Parallel Compaction(1.5) – Heap n area – Area Heap Size CPU, thread – Thread Area Compaction – » Move Step : Object » Fix-up Step : Object Reference
    • 253. Java Performance 147 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Parallel Compaction(1.5) – Move Step T1 T2 T1 T2
    • 254. Java Performance 148 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Parallel Compaction(1.5) – Move Step » Thread Source Area Destination Area » Object Moving Pointer bitmap » Hole Area » Area Size Hole Load Balancing
    • 255. Java Performance 149 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Parallel Compaction(1.5) – Fix-up Step » reference update » Block table » Block 256Kb Heap » Fix-up Block » Block object , » Object Block
    • 256. Java Performance 150 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Compaction Phase • Parallel Compaction(1.5) – Block Table » Block 1 Pointer » Block Object – Object Bitmap » Old Bitmap : Move Object (Mark Phase) » New Bitmap : Move Object (Moving Step)
    • 257. Java Performance 151 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for throughput – Options • -Xgcthreads<thread > – GC Parallel Thread – Default CPU – 1, Min 1, Max CPU • -Xgcworkpackets<numbers> – Workpacket default maximum heap size packet • -Xpartialcompactgc – Incremental compaction (1.4.2 default) – 5.0 not set, full compaction • -Xnopartialcompactgc – Incremental Compaction
    • 258. Java Performance 152 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – GC Pause Time – Background thread Application concurrent mark, sweep – Mark Phase : Concurrent Mark – Sweep Phase • 1.4 -Parallel bitwise Sweep, • Java 5 -Concurrent Sweep – Compaction Phase • 1.4 - Incremental Compaction, • Java 5 -Mostly Concurrent Compaction
    • 259. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~
    • 260. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~
    • 261. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark
    • 262. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Sweep
    • 263. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Sweep
    • 264. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Sweep Compaction
    • 265. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Sweep Compaction
    • 266. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Sweep Compaction
    • 267. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Concurrent Mark Sweep Compaction
    • 268. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Concurrent Mark Sweep Concurrent Sweep Compaction
    • 269. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Concurrent Mark Sweep Concurrent Sweep Compaction
    • 270. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Concurrent Mark Sweep Concurrent Sweep Compaction Compaction
    • 271. Java Performance 153 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time ~ 1.4.2 Java5 ~ Concurrent Mark Concurrent Mark Sweep Concurrent Sweep Compaction Compaction
    • 272. Java Performance 154 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Concurrent Mark • Thread Stack Scan root • Trace background thread • Thread marking – trace Object – Object reference write barrier heap – Heap 512byte 1byte card card table – Reference object 0x01
    • 273. Java Performance 155 Java Performance Fundamental | twitter @novathinker IBM JVM artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Concurrent Mark • Object Allocation ‘tax’ rate – STW – heap Marking – Garbage Collection Thread Application Thread – Garbage Collection Tax
    • 274. Java Performance 156 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Stop the World Phase • Root Scan • Marked Card • Sweep • Floating Garbage
    • 275. Java Performance 157 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Concurrent Sweep Phase • Java 5 • 1.4.2 Parallel Bitwise Sweep Algorithm • Parallel bit-wise Sweep • Heap Section Allocation Sweep • – Sweep Analysis » Markbit Data Section » Freelist – Connection
    • 276. Java Performance 158 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Concurrent Sweep Phase • Heap Section parallel bitwise sweep • Sweep STW • Allocation Process Concurrent Sweep • Compaction • Mark .
    • 277. Java Performance 159 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Java 5 • 1.4 Incremental Compaction • Compaction • STW Partial Move – Sweep Compact • Fixup Concurrently – Compaction Pause Time
    • 278. Java Performance 160 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Move Step – Application » Map2 Heap Fixup view » Map2 : Virtual Address range Physical Memory Map – Compact Area » Sweep Object Layout Compaction Section – Move – Object Compaction
    • 279. Java Performance 161 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • STW Fix-up – Root Reference Fixup – Heap page » Object Heap Page » Object Heap Page Unfixed – Lock » Free Page Fixed – Application Thread
    • 280. Java Performance 162 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up – unfixed page fixed – Unfixed(protected)  Busy  Fixed(unprotected) – Application fixed Page – Exclusive Fixer : Fix Thread – Collector Thread Fix – Trapped Thread : Application Thread Unfixed page Trap Routine
    • 281. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Unfixed Unfixed Unfixed Unfixed
    • 282. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Collector Unfixed Unfixed Unfixed Unfixed Unfixed
    • 283. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Exclusive Collector Unfixed Fixer Unfixed Unfixed Unfixed Unfixed
    • 284. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Exclusive Collector Unfixed Fixer Unfixed Unfixed Unfixed Unfixed
    • 285. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Exclusive Collector Unfixed Busy Fixer Unfixed Unfixed Unfixed Unfixed
    • 286. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Exclusive Collector Unfixed Fixed Busy Fixer Unfixed Unfixed Unfixed Unfixed
    • 287. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Exclusive Collector Unfixed Fixed Busy Fixer Unfixed Unfixed Unfixed Unfixed
    • 288. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Collector Unfixed Fixed Busy Unfixed Unfixed Unfixed Unfixed
    • 289. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Unfixed Unfixed Unfixed
    • 290. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Exclusive Collector Fixer Unfixed Unfixed Unfixed Unfixed
    • 291. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Exclusive Collector Fixer Unfixed Unfixed Unfixed Unfixed
    • 292. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Exclusive Collector Fixer Unfixed Busy Unfixed Unfixed Unfixed
    • 293. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Exclusive Collector Fixer Unfixed Busy Fixed Unfixed Unfixed Unfixed
    • 294. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Exclusive Collector Fixer Unfixed Busy Fixed Unfixed Unfixed Unfixed
    • 295. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Unfixed Unfixed
    • 296. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Unfixed
    • 297. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Unfixed
    • 298. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed blocke Mutator d Unfixed Unfixed
    • 299. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Unfixed
    • 300. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Trapped Mutator Unfixed Unfixed
    • 301. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Exclusive Trapped Mutator Fixer Unfixed Unfixed
    • 302. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Exclusive Trapped Mutator Fixer Unfixed Busy Unfixed
    • 303. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Exclusive Trapped Mutator Fixer Unfixed Busy Fixed Unfixed
    • 304. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Trapped Mutator Unfixed Busy Fixed Unfixed
    • 305. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Busy Fixed Unfixed
    • 306. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Busy Fixed Unfixed
    • 307. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Mutator Unfixed Busy Fixed Unfixed
    • 308. Java Performance 163 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Mostly Concurrent Compaction • Concurrent Fix-up Unfixed Fixed Busy Collector Unfixed Busy Fixed Unfixed Unfixed Busy Fixed Unfixed
    • 309. Java Performance 164 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Options • -Xconcurrentbackground<number> – Concurrent mark background GC Application Thread – Default 1 • -Xconcurrentlevel<number> – Tax rate – heap Tax – Default 8
    • 310. Java Performance 165 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Optimize for pause time – Options • -Xconmeter:<soa:loa:dynamic> – Concurrent Mark Allocation Tax – Dynamic – Default soa (Small Object Area)
    • 311. Java Performance 166 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent – Generation Heap Allocation Space Survivor Space Tenured Space New Area (Nursery) Old Area
    • 312. Java Performance 167 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent – Nursery : Object • Allocate Space : Object • Survivor Space : Allocate Space Allocation Failure Scavenge-Copy (GC : Stop-the-Copy) : Live Object • Allocate Space Survivor Space Flip
    • 313. Java Performance 168 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent – Tenured : Object Promotion • 14 GC Aging Promotion (adaptive) • Optavgpause concurrent mark • But sweep concurrent – Tilt Ratio : Adaptive Survivor Allocation Space Survivor Space Allocation Space Space 50% 80%
    • 314. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent
    • 315. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent
    • 316. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent
    • 317. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark
    • 318. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark
    • 319. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark
    • 320. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection
    • 321. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection
    • 322. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection
    • 323. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection
    • 324. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection Scavenge Copy
    • 325. Java Performance 169 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent Scavenge Copy Concurrent Mark Scavenge Copy Concurrent Mark Global Collection Scavenge Copy
    • 326. Java Performance 170 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent – Scavenge GC • New Area Garbage Collection • Stop The Copy Algorithm – Global GC • Tenured Area optavgpause Concurrent Mark • Concurrent Sweep • Nursery, tenured • GC Application Suspend • Compaction
    • 327. Java Performance 171 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Generation concurrent – Options • -Xmn<size> – New Area • -Xmns<size> : New Area • -Xmnx<size> : New Area • -Xmo<size> – Old Area • -Xmos<size> : Old Area • -Xmox<size> : Old Area
    • 328. Java Performance 172 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Subpooling – 16 CPU – Size Heap • Pool freelist • Pool sorting • Fast allocation – Allocation Heap Lock • CPU Pool
    • 329. Java Performance 173 IBM JVM Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com • Subpooling – Subpool • JVM Compaction Subpool • GC Sweep phase subpool • Concurrent Algorithm
    • 330. Java Performance 174 Java Performance Fundamental | twitter @novathinker artdb@ex-em.com | performeister.tistory.com

    ×