SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
<Insert Picture Here>




Understanding the Java Virtual Machine and
Low Latency Applications
Simon Ritter
Technology Evangelist
The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle s
products remains at the sole discretion of Oracle.
People Want Fast Applications

•  What does fast mean?
  •  “I want the answer as fast as possible”
  •  “I want all the answers as fast as possible”
•  These two goals are somewhat orthogonal from a
   programming perspective
•  One fast answer = Low Latency
•  All answers as fast as possible = High Throughput
The Java Virtual Machine
 Performance Considerations

•  It’s virtual, not physical
  •  Conversion from bytecodes to native instructions and library
     calls
  •  Interpreted mode and Just In Time (JIT) compilation
•  Automatic memory management
  •  new operator allocates space for an object
  •  Garbage collector eliminates the need for programmatic ‘free’
  •  No explicit pointer manipulation (much safer)
•  Multi-threaded
  •  Each object has a single monitor
  •  Programmatic locking, some automated unlocking
Application Stack


           Java Application


     Application Server (Optional)
                                      Impact that
                                        tuning
         Java Virtual Machine        changes will
                                         have
          Operating System

      Hardware (CPU/Memory/Bus)
Memory
Management
What You Need To Know About GC
  HotSpot VM Heap Layout




Removal planned for JDK8
What You Need To Know About GC
HotSpot VM Heap Layout
Important Concepts of GC

•  Frequency of minor GCs is dictated by:
  •  Rate of object allocation
  •  Size of the Eden space
•  Frequency of object promotion into tenured space is
   dictated by:
  •  Frequency of minor GCs (how quickly objects age)
  •  Size of the survivor spaces
  •  Tenuring threshold (default 7)
•  Ideally as little data as possible should be promoted
  •  Involves copying, thus I/O and must be stop-the-world
Important Concepts of GC

•  Object retention impacts latency more than object
   allocation
  •  GC only visits live objects
  •  GC time is a function of number of live objects and graph
     complexity
•  Object allocation is very cheap
  •  ~10 cycles in common case
  •  Compare to 30 cycles for fastest malloc algorithm
•  Reclaiming short lived objects is very cheap
  •  Weak generational hypothesis
Quick Rules of Thumb

•  Don’t be afraid to allocate quickly disposed of objects
  •  Especially for immediate results
•  GC loves small immutable objects and short-lived
   objects
  •  So long as they don’t survive a minor GC
•  Try to avoid complex inter-object relationships
  •  Reduce complexity of graph to be analysed by GC
Quick Rules of Thumb
 However…

•  Don’t allocate objects needlessly
  •    More frequent allocations means more frequent GCs
  •    More frequent GCs implies faster object aging
  •    Faster object aging means faster promotion to old generation
  •    Which means more frequent concurrent collections or full
       compacting collections of the old generation
•  It is better to use short-lived immutable objects than
   long-lived mutable objects
The Ideal GC Scenario

•  After application initialization phase, only experience
   minor GCs and old generation growth is negligible
  •  Ideally, never experience need for Old Generation collection
  •  Minor GCs are [generally] the fastest
•  Start with Parallel GC
  •  i.e. -XX:+UseParallelOldGC or -XX:+UseParallelGC
  •  Parallel GC offers the fastest minor GC times
       •  So long as you have multiple cores/CPUs
•  Move to CMS if Old Generation collection is needed
  •  Minor GC times will be slower due to promotion into free lists
  •  Hopefully this will avoid full compacting collection of old gen.
Concurrent GC
 Interesting Aside

•  Concurrent collectors require a write barrier to track
   potential hidden live objects
  •  The write barrier tracks all writes to objects and records the
     creation and removal of references between objects
•  Write barriers introduce performance overhead
  •  Size of overhead depends on implementation
•  Stop-the-world GC does not require write barrier
•  Hence, ideal situation is:
  •  Use Parallel GC or ParallelOld GC and avoid Old Gen.
     collection
  •  Thus avoiding full GC
GC Friendly Programming (1)

•  Large objects
  •  Expensive to allocate (may not use fast path, straight in Old
     Gen.)
  •  Expensive to initialise (Java spec. requires zeroing)
•  Large objects of different size can cause heap
   fragmentation
  •  For non-compacting or partially compacting GCs
•  Avoid large object allocations (if you can)
  •  Especially frequent large object allocations during application
     “steady state”
  •  Not so bad during application warm-up (pooling)
GC Friendly Programming (2)

•  Data structure resizing
  •  Avoid resizing of array backed “container objects”
  •  Use the constructor that takes an explicit size parameter
•  Resizing leads to unnecessary object allocation
  •  Can also contribute to fragmentation (non-compacting GC)
•  Object pooling issues
  •  Contributes to live objects visited during GC
      •  GC pause is function of number of live objects
  •  Access to the pool requires locking
      •  Scalability issue
  •  Weigh against benefits of large object allocation at start-up
GC Friendly Programming (3)

•  Finalizers
  •    Simple rule: DON’T USE THEM!
  •    Unless you really, really, really (and I mean REALLY) have to
  •    Requires at least 2 GCs cycles and GC cycles are slower
  •    Use a method to explicitly free resources and manage this
       manually before object is no longer required
•  Reference objects
  •  Possible alternative to finalizers (as an almost last resort)
• SoftReference important note
  •  Referent is cleared by the GC, how aggressive it is at clearing
     is at the mercy of the GC's implementation
  •  The “aggressiveness” dictates the degree of object retention
Subtle Object Retention (1)

•  Consider this class:
  class MyImpl extends ClassWithFinalizer {
    private byte[] buffer = new byte[1024 * 1024 * 2];
    ....
•  Consequences of finalizer in super-class
  •  At least 2 GC cycles to free the byte array
•  One solution
  class MyImpl {
    private ClassWithFinalier classWithFinalizer;
    private byte[] buffer = new byte[1024 * 1024 * 2];
    ....
Subtle Object Retention (2)

•  Inner classes
  •  Have an implicit reference to the outer instance
  •  Can potentially increase object retention and graph
     complexity
•  Net affect is the potential for increased GC duration
  •  Thus increased latency
Garbage First (G1) Garbage Collection

•  Known limitations in current GC algorithms
  •    CMS: No compaction, need for a remark phase
  •    ParallelOld: Full heap compaction, potentially long STW pauses
  •    Pause target can be set, but is a best-effort, no guarantees
  •    Problems arise with increase in heap, throughput and live set


•  G1 Collector
  •  Detlef, Flood, Heller, Printezis - 2004
G1 Collector

•  CMS Replacement (available JRE 7 u4 onwards)
•  Server “Style” Garbage Collector
•  Parallel
•  Concurrent                          Main differences
•  Generational                            between
                                        CMS and G1
•  Good Throughput
•  Compacting
•  Improved ease-of-use
•  Predictable (though not hard real-time)
G1 Collector
 High Level Overview

•  Region based heap
  •  Dynamic young generation sizing
  •  Partial compaction using evacuation
•  Snapshot At The Beginning (SATB)
  •  Avoids remark phase
•  Pause target
  •  Select number of regions in young and mixed collections that
     fits target
•  Garbage First
  •  Select regions that contain mostly garbage
  •  Minimal work for maximal return
Colour Key


  Non-Allocated Space
  Young Generation
  Old Generation
  Recently Copied in Young Generation
  Recently Copied in Old Generation
Young GCs in CMS


                    •  Young generation, split into
                      •  Eden
                      •  Survivor spaces
                    •  Old generation
                      •  In-place de-allocation
                      •  Managed by free lists




CMS
Young GCs in CMS


                    •  End of young generation GC




CMS
Young GCs in G1

                             G1
•  Heap split into regions
  •  Currently 1MB regions
•  Young generation
  •  A set of regions
•  Old generation
  •  A set of regions
Young GCs in G1

                                 G1
•  During a young
   generation GC
  •  Survivors from the young
     regions are evacuated to:
      •  Survivor regions
      •  Old regions
Young GCs in G1

                                G1
•  End of young generation GC
Old GCs in CMS (Sweeping After Marking)


                    •  Concurrent marking
                       phase
                      •  Two stop-the-world pauses
                          •  Initial mark
                          •  Remark
                      •  Marks reachable (live)
                         objects
                      •  Unmarked objects are
                         deduced to be unreachable
                         (dead)

CMS
Old GCs in CMS (Sweeping After Marking)


                    •  End of concurrent
                       sweeping phase
                      •  All unmarked objects are de-
                         allocated




CMS
Old GCs in G1 (After Marking)

                                     G1
•  Concurrent marking
   phase
  •  One stop-the-world pause
      •  Remark
      •  (Initial mark piggybacked
         on an evacuation pause)
  •  Calculates liveness
     information per region
      •  Empty regions can be
         reclaimed immediately
Old GCs in G1 (After Marking)

                                G1
•  End of remark phase
Old GCs in G1 (After Marking)

                                   G1
•  Reclaiming old regions
  •  Pick regions with low live
     ratio
  •  Collect them piggy-backed
     on young GCs
      •  Only a few old regions
         collected per such GC
Old GCs in G1 (After Marking)

                                   G1
•  We might leave some
   garbage objects in the
   heap
  •  In regions with very high
     live ratio
  •  We might collect them later
CMS vs. G1 Comparison


                         G1




CMS
Latency Is A Key Goal

•  Oracle actively researching new ways to reduce
   latency and make it more predictable
•  Which direction this work goes in needs to be driven
   by requirements
Adaptive
Compilation
JIT Compilation Facts
 Optimisation Decisions

•  Data: classes loaded and code paths executed
  •  JIT compiler does not know about all code in application
      •  Unlike traditional compiler
  •  Optimisation decisions based on runtime history
      •  No potential to predict future profile
  •  Decisions made may turn out to be sub-optimal later
      •  Limits some types of optimisations used
  •  As profile changes JIT needs to react
      •  Throw away compiled code no longer required
      •  Re-optimise based on new profile
JIT Compilation Facts
 Internal Profiling
•  Need to determine which methods are hot or cold
•  Invocation counting
  •  Handled by bytecode interpreter or including an add
     instruction to native code
  •  Can have noticeable run-time overhead
•  Thread sampling
  •  periodically check thread code, register instruction pointers
  •  Minimising application disruption requires custom thread
     implementation or OS support
•  Hardware based sampling
  •  Platform specific instrumentation mechanisms
JIT Compilation Facts
 JIT Assumptions

•  Methods will probably not be overridden
  •  Can be called with a fixed address
•  A float will probably never be NaN
  •  Use hardware instructions rather than floating point library
•  Exceptions will probably not be thrown in a try block
  •  All catch blocks are marked as cold
•  A lock will probably not be saturated
  •  Start as a fast spinlock
•  A lock will probably be taken and released by the same
   thread
  •  Sequential unlock/acquire operations can be treated as a no-op
Inlining and Virtualisation
 Competing Forces

•  Most effective optimisation is method inlining
•  Virtualised methods are the biggest barrier to this
•  Good news:
  •  JIT can de-virtualize methods if it only sees 1 implementation
  •  Makes it a mono-morphic call
•  Bad news:
  •  if JIT compiler later discovers an additional implementation it
     must de-optimize
  •  Re-optimise to make it a bi-morphic call
  •  Reduced performance, especially if extended to third method
     and multi-morphic call
Inlining and Virtualisation
 Important Points

•  Implementation changes during “steady-state”
  •  Will slow down application
•  Write JIT friendly code?
  •  No! Remember, “Beware premature optimisation”
•  What to do?
  •  Code naturally and let the JIT figure it out
  •  Profile to find problem areas
  •  Modify code only for problem areas to improve performance
Conclusions

•  Java uses a virtual machine, so:
  •  Has automatic memory management
  •  Has adaptive compilation of bytecodes
•  How these features work will have a significant impact
   on the performance of your application
•  Profile, profile, profile!
•  Avoid premature optimisation
Resources

•  www.oracle.com/technetwork/java/javase/gc-
   tuning-6-140523.html
•  www.oracle.com/technetwork/java/javase/tech/
   vmoptions-jsp-140102.html
•  middlewaremagic.com/weblogic/?p=6930
Understanding the Java Virtual Machine and Low Latency Applications

Más contenido relacionado

La actualidad más candente

Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey J On The Beach
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCDCloudOps2005
 
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어NHN FORWARD
 
Java garbage collection & GC friendly coding
Java garbage collection  & GC friendly codingJava garbage collection  & GC friendly coding
Java garbage collection & GC friendly codingMd Ayub Ali Sarker
 
Keynote DevOps - Microsoft DevOps Day 2014 in Paris
Keynote DevOps - Microsoft DevOps Day 2014 in ParisKeynote DevOps - Microsoft DevOps Day 2014 in Paris
Keynote DevOps - Microsoft DevOps Day 2014 in ParisJason De Oliveira
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Apache Kafka, Un système distribué de messagerie hautement performant
Apache Kafka, Un système distribué de messagerie hautement performantApache Kafka, Un système distribué de messagerie hautement performant
Apache Kafka, Un système distribué de messagerie hautement performantALTIC Altic
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep DiveWill Kinard
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes VMware Tanzu
 
Grafana overview deck - Tech - 2023 May v1.pdf
Grafana overview deck  - Tech - 2023 May v1.pdfGrafana overview deck  - Tech - 2023 May v1.pdf
Grafana overview deck - Tech - 2023 May v1.pdfBillySin5
 
What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)Opsta
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflixaspyker
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Python qgis advanced
Python qgis advancedPython qgis advanced
Python qgis advancedJiyoon Kim
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 

La actualidad más candente (20)

Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Jenkins.pdf
Jenkins.pdfJenkins.pdf
Jenkins.pdf
 
Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey
 
Terraform
TerraformTerraform
Terraform
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCD
 
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
[2018] NHN 모니터링의 현재와 미래 for 인프라 엔지니어
 
Java garbage collection & GC friendly coding
Java garbage collection  & GC friendly codingJava garbage collection  & GC friendly coding
Java garbage collection & GC friendly coding
 
Keynote DevOps - Microsoft DevOps Day 2014 in Paris
Keynote DevOps - Microsoft DevOps Day 2014 in ParisKeynote DevOps - Microsoft DevOps Day 2014 in Paris
Keynote DevOps - Microsoft DevOps Day 2014 in Paris
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Apache Kafka, Un système distribué de messagerie hautement performant
Apache Kafka, Un système distribué de messagerie hautement performantApache Kafka, Un système distribué de messagerie hautement performant
Apache Kafka, Un système distribué de messagerie hautement performant
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Grafana overview deck - Tech - 2023 May v1.pdf
Grafana overview deck  - Tech - 2023 May v1.pdfGrafana overview deck  - Tech - 2023 May v1.pdf
Grafana overview deck - Tech - 2023 May v1.pdf
 
What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)What you have to know about Certified Kubernetes Administrator (CKA)
What you have to know about Certified Kubernetes Administrator (CKA)
 
Présentation Docker
Présentation DockerPrésentation Docker
Présentation Docker
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflix
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Python qgis advanced
Python qgis advancedPython qgis advanced
Python qgis advanced
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 

Destacado

Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015ontopic
 
StormCrawler in the wild
StormCrawler in the wildStormCrawler in the wild
StormCrawler in the wildJulien Nioche
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Reporttilman.holschuh
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...elliando dias
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologieshwilming
 
A quick introduction to Storm Crawler
A quick introduction to Storm CrawlerA quick introduction to Storm Crawler
A quick introduction to Storm CrawlerJulien Nioche
 
The new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiThe new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiCyril Lakech
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick GuideAnton Shchastnyi
 
Intro To Sap Netweaver Java
Intro To Sap Netweaver JavaIntro To Sap Netweaver Java
Intro To Sap Netweaver JavaLeland Bartlett
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesSangjin Lee
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorRobert Panzer
 
LMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleLMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleGuy Nir
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjectsMarcel Mitran
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteberndmueller
 

Destacado (20)

Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015
 
StormCrawler in the wild
StormCrawler in the wildStormCrawler in the wild
StormCrawler in the wild
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
SAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner WebinarSAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner Webinar
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Report
 
Sap java
Sap javaSap java
Sap java
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologies
 
A quick introduction to Storm Crawler
A quick introduction to Storm CrawlerA quick introduction to Storm Crawler
A quick introduction to Storm Crawler
 
The new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiThe new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spi
 
Get Back in Control of your SQL
Get Back in Control of your SQLGet Back in Control of your SQL
Get Back in Control of your SQL
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick Guide
 
Die Java Plattform Strategie
Die Java Plattform StrategieDie Java Plattform Strategie
Die Java Plattform Strategie
 
Intro To Sap Netweaver Java
Intro To Sap Netweaver JavaIntro To Sap Netweaver Java
Intro To Sap Netweaver Java
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the Trenches
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
 
LMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleLMAX Disruptor as real-life example
LMAX Disruptor as real-life example
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjects
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollte
 

Similar a Understanding the Java Virtual Machine and Low Latency Applications

Diagnosing Problems in Production: Cassandra Summit 2014
Diagnosing Problems in Production: Cassandra Summit 2014Diagnosing Problems in Production: Cassandra Summit 2014
Diagnosing Problems in Production: Cassandra Summit 2014Jon Haddad
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionHaribabu Nandyal Padmanaban
 
Webinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionWebinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionDataStax Academy
 
Webinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionWebinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionDataStax Academy
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraJon Haddad
 
Staying friendly with the gc
Staying friendly with the gcStaying friendly with the gc
Staying friendly with the gcOren Eini
 
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorJava Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorGurpreet Sachdeva
 
Cassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionCassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionDataStax Academy
 
Cassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionCassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionDataStax Academy
 
Chronicles Of Garbage Collection (GC)
Chronicles Of Garbage Collection (GC)Chronicles Of Garbage Collection (GC)
Chronicles Of Garbage Collection (GC)Techizzaa
 
Diagnosing Problems in Production (Nov 2015)
Diagnosing Problems in Production (Nov 2015)Diagnosing Problems in Production (Nov 2015)
Diagnosing Problems in Production (Nov 2015)Jon Haddad
 
Cassandra Day Atlanta 2015: Diagnosing Problems in Production
Cassandra Day Atlanta 2015: Diagnosing Problems in ProductionCassandra Day Atlanta 2015: Diagnosing Problems in Production
Cassandra Day Atlanta 2015: Diagnosing Problems in ProductionDataStax Academy
 
Cassandra Day Chicago 2015: Diagnosing Problems in Production
Cassandra Day Chicago 2015: Diagnosing Problems in ProductionCassandra Day Chicago 2015: Diagnosing Problems in Production
Cassandra Day Chicago 2015: Diagnosing Problems in ProductionDataStax Academy
 
Cassandra Day London 2015: Diagnosing Problems in Production
Cassandra Day London 2015: Diagnosing Problems in ProductionCassandra Day London 2015: Diagnosing Problems in Production
Cassandra Day London 2015: Diagnosing Problems in ProductionDataStax Academy
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展Leon Chen
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First ClusterDataStax Academy
 
Java Garbage Collector and The Memory Model
Java Garbage Collector and The Memory ModelJava Garbage Collector and The Memory Model
Java Garbage Collector and The Memory ModelErnesto Arroyo Ron
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011Kris Mok
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Monica Beckwith
 

Similar a Understanding the Java Virtual Machine and Low Latency Applications (20)

Diagnosing Problems in Production: Cassandra Summit 2014
Diagnosing Problems in Production: Cassandra Summit 2014Diagnosing Problems in Production: Cassandra Summit 2014
Diagnosing Problems in Production: Cassandra Summit 2014
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
 
Webinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionWebinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in Production
 
Webinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in ProductionWebinar: Diagnosing Apache Cassandra Problems in Production
Webinar: Diagnosing Apache Cassandra Problems in Production
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - Cassandra
 
Staying friendly with the gc
Staying friendly with the gcStaying friendly with the gc
Staying friendly with the gc
 
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorJava Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
 
Cassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionCassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in Production
 
Cassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in ProductionCassandra Summit 2014: Diagnosing Problems in Production
Cassandra Summit 2014: Diagnosing Problems in Production
 
Chronicles Of Garbage Collection (GC)
Chronicles Of Garbage Collection (GC)Chronicles Of Garbage Collection (GC)
Chronicles Of Garbage Collection (GC)
 
Advanced Operations
Advanced OperationsAdvanced Operations
Advanced Operations
 
Diagnosing Problems in Production (Nov 2015)
Diagnosing Problems in Production (Nov 2015)Diagnosing Problems in Production (Nov 2015)
Diagnosing Problems in Production (Nov 2015)
 
Cassandra Day Atlanta 2015: Diagnosing Problems in Production
Cassandra Day Atlanta 2015: Diagnosing Problems in ProductionCassandra Day Atlanta 2015: Diagnosing Problems in Production
Cassandra Day Atlanta 2015: Diagnosing Problems in Production
 
Cassandra Day Chicago 2015: Diagnosing Problems in Production
Cassandra Day Chicago 2015: Diagnosing Problems in ProductionCassandra Day Chicago 2015: Diagnosing Problems in Production
Cassandra Day Chicago 2015: Diagnosing Problems in Production
 
Cassandra Day London 2015: Diagnosing Problems in Production
Cassandra Day London 2015: Diagnosing Problems in ProductionCassandra Day London 2015: Diagnosing Problems in Production
Cassandra Day London 2015: Diagnosing Problems in Production
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Java Garbage Collector and The Memory Model
Java Garbage Collector and The Memory ModelJava Garbage Collector and The Memory Model
Java Garbage Collector and The Memory Model
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
 

Más de Simon Ritter

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native CompilerSimon Ritter
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type PatternsSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern JavaSimon Ritter
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVMSimon Ritter
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New FeaturesSimon Ritter
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDKSimon Ritter
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologySimon Ritter
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologySimon Ritter
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?Simon Ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12Simon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still FreeSimon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveSimon Ritter
 

Más de Simon Ritter (20)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
 

Último

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Understanding the Java Virtual Machine and Low Latency Applications

  • 1.
  • 2. <Insert Picture Here> Understanding the Java Virtual Machine and Low Latency Applications Simon Ritter Technology Evangelist
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle.
  • 4. People Want Fast Applications •  What does fast mean? •  “I want the answer as fast as possible” •  “I want all the answers as fast as possible” •  These two goals are somewhat orthogonal from a programming perspective •  One fast answer = Low Latency •  All answers as fast as possible = High Throughput
  • 5. The Java Virtual Machine Performance Considerations •  It’s virtual, not physical •  Conversion from bytecodes to native instructions and library calls •  Interpreted mode and Just In Time (JIT) compilation •  Automatic memory management •  new operator allocates space for an object •  Garbage collector eliminates the need for programmatic ‘free’ •  No explicit pointer manipulation (much safer) •  Multi-threaded •  Each object has a single monitor •  Programmatic locking, some automated unlocking
  • 6. Application Stack Java Application Application Server (Optional) Impact that tuning Java Virtual Machine changes will have Operating System Hardware (CPU/Memory/Bus)
  • 8. What You Need To Know About GC HotSpot VM Heap Layout Removal planned for JDK8
  • 9. What You Need To Know About GC HotSpot VM Heap Layout
  • 10. Important Concepts of GC •  Frequency of minor GCs is dictated by: •  Rate of object allocation •  Size of the Eden space •  Frequency of object promotion into tenured space is dictated by: •  Frequency of minor GCs (how quickly objects age) •  Size of the survivor spaces •  Tenuring threshold (default 7) •  Ideally as little data as possible should be promoted •  Involves copying, thus I/O and must be stop-the-world
  • 11. Important Concepts of GC •  Object retention impacts latency more than object allocation •  GC only visits live objects •  GC time is a function of number of live objects and graph complexity •  Object allocation is very cheap •  ~10 cycles in common case •  Compare to 30 cycles for fastest malloc algorithm •  Reclaiming short lived objects is very cheap •  Weak generational hypothesis
  • 12. Quick Rules of Thumb •  Don’t be afraid to allocate quickly disposed of objects •  Especially for immediate results •  GC loves small immutable objects and short-lived objects •  So long as they don’t survive a minor GC •  Try to avoid complex inter-object relationships •  Reduce complexity of graph to be analysed by GC
  • 13. Quick Rules of Thumb However… •  Don’t allocate objects needlessly •  More frequent allocations means more frequent GCs •  More frequent GCs implies faster object aging •  Faster object aging means faster promotion to old generation •  Which means more frequent concurrent collections or full compacting collections of the old generation •  It is better to use short-lived immutable objects than long-lived mutable objects
  • 14. The Ideal GC Scenario •  After application initialization phase, only experience minor GCs and old generation growth is negligible •  Ideally, never experience need for Old Generation collection •  Minor GCs are [generally] the fastest •  Start with Parallel GC •  i.e. -XX:+UseParallelOldGC or -XX:+UseParallelGC •  Parallel GC offers the fastest minor GC times •  So long as you have multiple cores/CPUs •  Move to CMS if Old Generation collection is needed •  Minor GC times will be slower due to promotion into free lists •  Hopefully this will avoid full compacting collection of old gen.
  • 15. Concurrent GC Interesting Aside •  Concurrent collectors require a write barrier to track potential hidden live objects •  The write barrier tracks all writes to objects and records the creation and removal of references between objects •  Write barriers introduce performance overhead •  Size of overhead depends on implementation •  Stop-the-world GC does not require write barrier •  Hence, ideal situation is: •  Use Parallel GC or ParallelOld GC and avoid Old Gen. collection •  Thus avoiding full GC
  • 16. GC Friendly Programming (1) •  Large objects •  Expensive to allocate (may not use fast path, straight in Old Gen.) •  Expensive to initialise (Java spec. requires zeroing) •  Large objects of different size can cause heap fragmentation •  For non-compacting or partially compacting GCs •  Avoid large object allocations (if you can) •  Especially frequent large object allocations during application “steady state” •  Not so bad during application warm-up (pooling)
  • 17. GC Friendly Programming (2) •  Data structure resizing •  Avoid resizing of array backed “container objects” •  Use the constructor that takes an explicit size parameter •  Resizing leads to unnecessary object allocation •  Can also contribute to fragmentation (non-compacting GC) •  Object pooling issues •  Contributes to live objects visited during GC •  GC pause is function of number of live objects •  Access to the pool requires locking •  Scalability issue •  Weigh against benefits of large object allocation at start-up
  • 18. GC Friendly Programming (3) •  Finalizers •  Simple rule: DON’T USE THEM! •  Unless you really, really, really (and I mean REALLY) have to •  Requires at least 2 GCs cycles and GC cycles are slower •  Use a method to explicitly free resources and manage this manually before object is no longer required •  Reference objects •  Possible alternative to finalizers (as an almost last resort) • SoftReference important note •  Referent is cleared by the GC, how aggressive it is at clearing is at the mercy of the GC's implementation •  The “aggressiveness” dictates the degree of object retention
  • 19. Subtle Object Retention (1) •  Consider this class: class MyImpl extends ClassWithFinalizer { private byte[] buffer = new byte[1024 * 1024 * 2]; .... •  Consequences of finalizer in super-class •  At least 2 GC cycles to free the byte array •  One solution class MyImpl { private ClassWithFinalier classWithFinalizer; private byte[] buffer = new byte[1024 * 1024 * 2]; ....
  • 20. Subtle Object Retention (2) •  Inner classes •  Have an implicit reference to the outer instance •  Can potentially increase object retention and graph complexity •  Net affect is the potential for increased GC duration •  Thus increased latency
  • 21. Garbage First (G1) Garbage Collection •  Known limitations in current GC algorithms •  CMS: No compaction, need for a remark phase •  ParallelOld: Full heap compaction, potentially long STW pauses •  Pause target can be set, but is a best-effort, no guarantees •  Problems arise with increase in heap, throughput and live set •  G1 Collector •  Detlef, Flood, Heller, Printezis - 2004
  • 22. G1 Collector •  CMS Replacement (available JRE 7 u4 onwards) •  Server “Style” Garbage Collector •  Parallel •  Concurrent Main differences •  Generational between CMS and G1 •  Good Throughput •  Compacting •  Improved ease-of-use •  Predictable (though not hard real-time)
  • 23. G1 Collector High Level Overview •  Region based heap •  Dynamic young generation sizing •  Partial compaction using evacuation •  Snapshot At The Beginning (SATB) •  Avoids remark phase •  Pause target •  Select number of regions in young and mixed collections that fits target •  Garbage First •  Select regions that contain mostly garbage •  Minimal work for maximal return
  • 24. Colour Key Non-Allocated Space Young Generation Old Generation Recently Copied in Young Generation Recently Copied in Old Generation
  • 25. Young GCs in CMS •  Young generation, split into •  Eden •  Survivor spaces •  Old generation •  In-place de-allocation •  Managed by free lists CMS
  • 26. Young GCs in CMS •  End of young generation GC CMS
  • 27. Young GCs in G1 G1 •  Heap split into regions •  Currently 1MB regions •  Young generation •  A set of regions •  Old generation •  A set of regions
  • 28. Young GCs in G1 G1 •  During a young generation GC •  Survivors from the young regions are evacuated to: •  Survivor regions •  Old regions
  • 29. Young GCs in G1 G1 •  End of young generation GC
  • 30. Old GCs in CMS (Sweeping After Marking) •  Concurrent marking phase •  Two stop-the-world pauses •  Initial mark •  Remark •  Marks reachable (live) objects •  Unmarked objects are deduced to be unreachable (dead) CMS
  • 31. Old GCs in CMS (Sweeping After Marking) •  End of concurrent sweeping phase •  All unmarked objects are de- allocated CMS
  • 32. Old GCs in G1 (After Marking) G1 •  Concurrent marking phase •  One stop-the-world pause •  Remark •  (Initial mark piggybacked on an evacuation pause) •  Calculates liveness information per region •  Empty regions can be reclaimed immediately
  • 33. Old GCs in G1 (After Marking) G1 •  End of remark phase
  • 34. Old GCs in G1 (After Marking) G1 •  Reclaiming old regions •  Pick regions with low live ratio •  Collect them piggy-backed on young GCs •  Only a few old regions collected per such GC
  • 35. Old GCs in G1 (After Marking) G1 •  We might leave some garbage objects in the heap •  In regions with very high live ratio •  We might collect them later
  • 36. CMS vs. G1 Comparison G1 CMS
  • 37. Latency Is A Key Goal •  Oracle actively researching new ways to reduce latency and make it more predictable •  Which direction this work goes in needs to be driven by requirements
  • 39. JIT Compilation Facts Optimisation Decisions •  Data: classes loaded and code paths executed •  JIT compiler does not know about all code in application •  Unlike traditional compiler •  Optimisation decisions based on runtime history •  No potential to predict future profile •  Decisions made may turn out to be sub-optimal later •  Limits some types of optimisations used •  As profile changes JIT needs to react •  Throw away compiled code no longer required •  Re-optimise based on new profile
  • 40. JIT Compilation Facts Internal Profiling •  Need to determine which methods are hot or cold •  Invocation counting •  Handled by bytecode interpreter or including an add instruction to native code •  Can have noticeable run-time overhead •  Thread sampling •  periodically check thread code, register instruction pointers •  Minimising application disruption requires custom thread implementation or OS support •  Hardware based sampling •  Platform specific instrumentation mechanisms
  • 41. JIT Compilation Facts JIT Assumptions •  Methods will probably not be overridden •  Can be called with a fixed address •  A float will probably never be NaN •  Use hardware instructions rather than floating point library •  Exceptions will probably not be thrown in a try block •  All catch blocks are marked as cold •  A lock will probably not be saturated •  Start as a fast spinlock •  A lock will probably be taken and released by the same thread •  Sequential unlock/acquire operations can be treated as a no-op
  • 42. Inlining and Virtualisation Competing Forces •  Most effective optimisation is method inlining •  Virtualised methods are the biggest barrier to this •  Good news: •  JIT can de-virtualize methods if it only sees 1 implementation •  Makes it a mono-morphic call •  Bad news: •  if JIT compiler later discovers an additional implementation it must de-optimize •  Re-optimise to make it a bi-morphic call •  Reduced performance, especially if extended to third method and multi-morphic call
  • 43. Inlining and Virtualisation Important Points •  Implementation changes during “steady-state” •  Will slow down application •  Write JIT friendly code? •  No! Remember, “Beware premature optimisation” •  What to do? •  Code naturally and let the JIT figure it out •  Profile to find problem areas •  Modify code only for problem areas to improve performance
  • 44. Conclusions •  Java uses a virtual machine, so: •  Has automatic memory management •  Has adaptive compilation of bytecodes •  How these features work will have a significant impact on the performance of your application •  Profile, profile, profile! •  Avoid premature optimisation
  • 45. Resources •  www.oracle.com/technetwork/java/javase/gc- tuning-6-140523.html •  www.oracle.com/technetwork/java/javase/tech/ vmoptions-jsp-140102.html •  middlewaremagic.com/weblogic/?p=6930