Deep Dive Into the Eclipse Openj9 GC Technologies

Deep Dive Into the Eclipse Openj9 GC Technologies

Deep dive into the Eclipse OpenJ9 GC technologies Charlie Gracie IBM Senior Software Developer [email protected] @crgracie charliegracie 1 Important Disclaimers • THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. • WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. • ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES. • ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. • IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. • IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. • NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: • CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS 2 About me • Senior Software Developer on the IBM Runtime Technologies Team • Project Lead on Eclipse OMR and a committer on Eclipse OpenJ9 • Has worked on Garbage Collection Technology for over 10 years with a focus on scalability 3 OpenJ9 GC technologies • Open J9 Project • Garbage collection overview • Open J9 GC technologies • Questions 4 Eclipse OpenJ9 Created Sept 2017 http://www.eclipse.org/openj9 https://github.com/eclipse/openj9 Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md 5 The place to get OpenJDK builds For both: • OpenJDK with Hotspot • OpenJDK with Eclipse OpenJ9 https://adoptopenjdk.net/releases.html?va riant=openjdk9-openj9 6 Eclipse OMR Created March 2016 http://www.eclipse.org/omr https://github.com/eclipse/omr https://developer.ibm.com/open/omr/ Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/omr/blob/master/CONTRIBUTING.md 7 Garbage Collection “Garbage Collection (GC) is form automatic memory management. The garbage collector attempts to reclaim memory occupied by objects that are no longer is use by the program.” 8 Garbage Collection Positives: 1. Automatic memory management 2. Help reduce certain categories of bugs Negatives: 1. Requires additional resources 2. Can cause application pauses 3. May introduce runtime costs 4. Application has little control of when memory is reclaimed 9 OpenJ9 GC goals 1. Implement re-usable technology 2. Provide highly scalable GC technology 3. Favor smaller memory consumption 10 Garbage collection policies • -Xgcpolicy: 1. optthruput – stop the world parallel collector 11 Garbage collection policies • -Xgcpolicy: 1. optthruput – stop the world parallel collector 2. optavgpause – concurrent collector 12 Garbage collection policies • -Xgcpolicy: 1. optthruput – stop the world parallel collector 2. optavgpause – concurrent collector 3. gencon – generational copying collector 13 Garbage collection policies • -Xgcpolicy: 1. optthruput – stop the world parallel collector 2. optavgpause – concurrent collector 3. gencon – generational copying collector 4. balanced – region based generational collector 14 Garbage collection policies • -Xgcpolicy: 1. optthruput – stop the world parallel collector 2. optavgpause – concurrent collector 3. gencon – generational copying collector 4. balanced – region based generational collector 5. metronome – incremental soft realtime collector 15 -Xgcpolicy:optthruput • Parallel global collector • GC operations are completed in Stop the world (STW) pauses • Mark, sweep and optional compaction collector • All GC operations are completed in parallel by multiple helper threads • GC native memory overhead for mark map and work packets 16 -Xgcpolicy:optthruput heap • Flat heap • 1 continuous block of memory Heap 17 -Xgcpolicy:optthruput heap • Flat heap • 1 continuous block of memory • Divided into 2 logical memory areas for allocation • SOA – small object area • LOA – large object area SOA LOA Heap 18 -Xgcpolicy:optthruput heap • Allocation is a first fit algorithm • OpenJ9 uses TLHs to improve allocation performance* Heap _freelist _freelist 19 -Xgcpolicy:optthruput heap • Allocation is a first fit algorithm • OpenJ9 uses TLHs to improve allocation performance* Heap _freelist _freelist 20 -Xgcpolicy:optthruput heap • Allocation is a first fit algorithm • OpenJ9 uses TLHs to improve allocation performance* Heap _freelist _freelist 21 -Xgcpolicy:optthruput heap • Allocation is a first fit algorithm • OpenJ9 uses TLHs to improve allocation performance* • Allocate until SOA is completely full Heap _freelist _freelist 22 -Xgcpolicy:optthruput heap • Allocation is a first fit algorithm • OpenJ9 uses TLHs to improve allocation performance* • Allocate until SOA is completely full • Now perform a GC Heap _freelist _freelist 23 -Xgcpolicy:optthruput GC 24 -Xgcpolicy:optthruput GC GC 1 GC 1 Start End 25 -Xgcpolicy:optthruput GC GC 1 GC 1 Start End 26 -Xgcpolicy:optthruput GC GC 1 GC 1 GC 2 GC 2 Start End Start End 27 -Xgcpolicy:optthruput GC GC 1 GC 1 GC 2 GC 2 Start End Start End 28 -Xgcpolicy:optthruput GC Each GC is divided into 3 phases: 1. Marking – finds all of the live objects 2. Sweeping – reclaims memory for dead objects 3. Compaction – (optional) defragment the heap 29 -Xgcpolicy:optthruput marking A B C D E F G H I J K L M N K L Heap 30 -Xgcpolicy:optthruput marking Root Set A D I L A B C D E F G H I J K L M N K L Heap 31 -Xgcpolicy:optthruput marking Root Set Mark map A D I L A B C D E F G H I J K L M N K L Heap 32 -Xgcpolicy:optthruput marking Root Set Mark map A D I L A B C D E F G H I J K L M N K L Heap 33 -Xgcpolicy:optthruput marking Root Set Mark map A 1 D I L A B C D E F G H I J K L M N K L Heap 34 -Xgcpolicy:optthruput marking Work Stack Output Root Set Input Mark map A 1 D I A L A B C D E F G H I J K L M N K L Heap 35 -Xgcpolicy:optthruput marking Work Stack Output Root Set Input Mark map A 1 1 D I D A L A B C D E F G H I J K L M N K L Heap 36 -Xgcpolicy:optthruput marking Work Stack Output Root Set Input Mark map A 1 1 1 D I I D A L A B C D E F G H I J K L M N K L Heap 37 -Xgcpolicy:optthruput marking Work Stack Output Root Set Input Mark map L A 1 1 1 1 D I I D A L A B C D E F G H I J K L M N K L Heap 38 -Xgcpolicy:optthruput marking Work Stack Input Output Mark map L 1 1 1 1 I D A A B C D E F G H I J K L M N K L Heap 39 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map L 1 1 1 1 I D A A B C D E F G H I J K L M N K L Heap 40 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AA L 1 1 1 1 D DI I ID L LA A B C D E F G H I J K L M N K L Heap 41 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ L 1 1 1 1 DS I IP D LY A A B C D E F G H I J K L M N K L Heap 42 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ L 1 1 1 1 DS I IP D LY A A B C D E F G H I J K L M N K L Heap 43 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 DS I IP D LY A A B C D E F G H I J K L M N K L Heap 44 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 DS I IP D LY A M A B C D E F G H I J K L M N K L Heap 45 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 DS IP D LY A M A B C D E F G H I J K L M N K L Heap 46 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 1 DS IP D K LY A M A B C D E F G H I J K L M N K L Heap 47 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 1 DS IP K LY A M A B C D E F G H I J K L M N K L Heap 48 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 1 1 DS F IP K LY A M A B C D E F G H I J K L M N K L Heap 49 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 1 1 DS F IP K LY M A B C D E F G H I J K L M N K L Heap 50 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ 1 1 1 1 1 1 1 DS F IP K LY M A B C D E F G H I J K L M N K L Heap 51 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ B 1 1 1 1 1 1 1 1 DS F IP K LY M A B C D E F G H I J K L M N K L Heap 52 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map AQ B 1 1 1 1 1 1 1 1 D SF I PK L YM A B C D E F G H I J K L M N K L Heap 53 -Xgcpolicy:optthruput marking Work Stack Work List Input Output Mark map 1 1 1 1 1 1 1 1 A B C D E F G H I J K L M N K L Heap 54 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B C D E F G H I J K L M N K L Heap 55 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B C D E F G H I J K L M N K L Heap 56 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B D E F G H I J K L M N K L Heap 57 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B D F G H I J K L M N K L Heap 58 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B D F I J K L M N K L Heap 59 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B D F I K L M N K L Heap 60 -Xgcpolicy:optthruput sweeping Mark map 1 1 1 1 1 1 1 1 _freelist A B D F I K M L Heap 61 -Xgcpolicy:optthruput

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    219 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us