SlideShare a Scribd company logo
The JVM MagicBaruch SadogurskyConsultant & Architect, AlphaCSP
AgendaIntroductionGC Magic 101General OptimizationsCompiler OptimizationsWhat can I do?Programming tipsJVM configuration flags2
Introduction
IntroductionIn the past, JVM was considered by many as Java Achilles’ heelInterpreter?!JVM team improved performance in 300 to 3000 timesJDK 1.6 compared to JDK 1.0Java is measured to be 50% to 100+% the speed of C and C++Jake2 vs Quake2How can it be?
Java Virtual Machines ZooCEE-J Excelsior JETHewlett-PackardJ9 (IBM)JbedJblendJrockitMRJMicroJvmMS JVMOJVMPERCBlackdown JavaCVMGemstoneGolden Code DevelopmentIntentNovellNSIcomCrE-MEChaiVMHotSpotAegisVMApache HarmonyCACAODalvikIcedTeaIKVM.NETJamigaJamVMJaosJCJelatine JVMJESSICAJikes RVMJnodeJOPJuiceJupiterJXKaffeleJOSMika VMMysaifuNanoVMSableVMSquawk virtual machineSuperWabaTinyVMVMkit of Low Level Virtual MachineWonka VMXam5
HotSpot Virtual MachineDeveloped by Longview Technologies  back in 1999Contains:Class loaderBytecode interpreter2 Virtual machines7 Garbage collectors2 CompilersRuntime libraries
HotSpot Virtual MachineConfigured by hundreds of –XX flagsReminder -X options are non-standard-XX options have specific system requirements for correct operationsBoth are subject to change without notice
GC Magic 101
GC Is Slow?GC has bad performance reputationReduces throughputIntroduces pausesUnpredictableUncontrolledPerformance degradation is proportional to objects countJust give me the damn free() and malloc()! I’ll be just fine!Is it so?
Generational CollectorsWeak generational hypothesisMost objects die young (AKA Infant mortality)Few old to young referencesGenerations: regions holding objects of different agesGC is done separately once a generation fillsDifferent GC algorithmsThe young (nursery) generationCollected by “Minor garbage collection”The old (tenured) generationCollected by “Minor garbage collection”
GC Magic 101vsYoung is better than TenuredLet your objects die in young generationWhen possible and makes sense11
GC Magic 10112vsSwapping is badApplication's memory footprint should not exceed the available physical memory
GC Magic 10113vsChoose:Throughput (client)Low-pause (server)
GC Magic 101http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html14
Tracking Collectors AlgorithmsMark-Sweep collectorMark phase marks each reachable objectSweep phase “sweeps” the heapNon marked objects reclaimed as garbageCopying collectorHeap is divided into two equal spacesWhen active space fills, live objects are copied to the unused spaceOnly live objects are examinedThe roles of the spaces are then flipped
CompactionCompaction: The collector moves all live objects to the bottom of the heapRemaining memory is reclaimedReduces the cost of objects allocationNo potential fragmentationThe drawback is slower completion of GC
The Young generationConsists of Eden + two survivor spaces  Objects are initially allocated in EdenAll HotSpot young collectors are stop-the-world copying collectorsDone is parallel for parallel garbage collectorsCollections are relatively fast and proportional to number of live objects
The Young generation
The Tenured generationObjects surviving several GC cycles, are promoted to the tenured generation Use -XX:MaxTenuringThreshold=# to changeCollectors algorithms used are variations of Mark-SweepMore space efficientCharacteristicsLower garbage densityBigger heap space Fewer GC cycles
Generetion Collectors
Garbage Collectors21
GC Flags22
When to Use23
Garbage First (G1)New in JDK 1.6 u14 (May 29th)All memory is divided to 1MB bucketsCalculates objects liveness in bucketsDrops “dead” bucketsIf a bucket is not total garbage, it’s not droppedCollects the most garbage buckets firstPauses only on “mark”No sweepUser can provide pause time goalsActual seconds or Percentage of runtimeG1 records bucket collection time and can estimate how many buckets to collect during pause
Garbage First (G1)Targets multi-process machines and large heapsG1 will be the long-term replacement for the CMS collectorUnlike CMS, compacts to battle fragmentationA bucket’s space is fully reclaimedBetter throughputPredictable pauses (high probability)Garbage left in buckets with high live ratioMay be collected later
Benefits of G1No imbalance of young-tenured generationGenerations are only logical Generations are merely sets of buckets More predictable GC pausesParallelism and concurrency in collections No fragmentation due to compactionBetter heap utilization Better GC ergonomics
Young GCs in G1Done using evacuation pausesStop-The-World parallel collectionsEvacuates surviving objects between sets of buckets
Old GCs in G1Drops dead bucketsCalculates liveness info per bucketIdentifies best buckets for subsequent eviction pausesCollect them piggy-backed on young GCs
GC Ergonomics29
GC ErgonomicsErgonomics goal is to provide good performance with little or no tuningBetter matches the needs of different application typesThe HotSpot, garbage collector and heap size are automatically chosenBased on OS, RAM and no# CPUServer Vs. Client class machineHints the characteristics of the application
GC Ergonomics
GC ErgonomicsWith the parallel collectors, one can specify performance goalsIn contrast to specifying the heap sizeImproves performance for large applicationsMax Pause Time GoalUse -XX:MaxGCPauseMillis=<N>Both generation separatelyOr: Average + VarianceNo pause time goal by default
GC ErgonomicsThroughput GoalUse -XX:GCTimeRatio=<N>The ratio of GC Vs. application time is 1/(1+N)If N=19, GC time goal is 1/(1+19) or 5%Default N is 99, meaning GC time is 1%  Minimum Footprint GoalPriority of goalsMaximum pause time goalThroughput goalMinimum footprint goal
GC ErgonomicsPerformance goals may not be metPause time and throughput goals are somewhat contradictingThe pause time goal shrinks the generationThe throughput goal grows the generationStatistics are kept by the GCAdaptive to changes in application behavior
GC Tweaking
Heap SizeThe larger the heap space, the betterFor both young and old generationLarger space: less frequent GCs, lower GC overhead, objects more likely to become garbageSmaller space: faster GCs (not always! see later)Sometimes max heap size is dictated by available memory and/or max space the JVM can addressYou have to find a good balance between young and old generation size
Heap SizeMaximize the number of objects reclaimed in the young generationApplication's memory footprint should not exceed the available physical memorySwapping is badThe above apply to all our GCs37
Heap Size-Xmx<size> : max heap sizeyoung generation + old generation-Xms<size> : initial heap sizeyoung generation + old generation-Xmn<size> : young generation size-XX:PermSize=<size> : permanent generation initial size-XX:MaxPermSize=<size> : permanent generation max size38
Heap SizeWhen -Xms != -Xmx, heap growth or shrinking requires a Full GCSet -Xms to desired heap size	Set –Xmx even higher “just in case”Even full GC is better than OOM crashSame for -XX:PermSize and -XX:MaxPermSizeSame for -XX:NewSize and-XX:MaxNewSize-Xmn Combines both39
TenuringMeasure tenuring with - XX:+PrintTenuringDistributionAvoid tenuring for short or even medium-lived objects!Less promotion into the old generationLess frequent old GCsPromote long-lived objects ASAPYeah, conflict with previous bulletBetter copy more, than promote more-XX:TargetSurvivorRatio=<percent>, e.g., 50How much of the survivor space should be filledTypically leave extra space to deal with “spikes”40
Permanent SpaceClasses aren’t unloaded by default-XX:+CMSClassUnloadingEnabled to enableClassloader should be collectedIt holds references to classesEach object holds reference to classloader41
GC Options42
GC Statistics OptionsGC logging has extremely low / non-existent overheadIt’s very helpful when diagnosing production issuesEnable itIn production too!-XX:+PrintGCPrintGCDetailsPrintGCTimeStampsPrintTenuringDistributionShow this threshold and the ages of objects in the new generation43
GC Is Slow? – The AnswersReduces throughputYou chooseIntroduces pausesYou chooseUnpredictableNot any moreUncontrolledConfigurablePerformance degradation is proportional to objects countNot trueJust give me the damn free() and malloc()! I’ll be just fine!Bad idea (see more later)
General Optimizations
HotSpot OptimizationsJIT CompilationCompiler OptimizationsGenerates more performant code that you could write in nativeAdaptive OptimizationSplit Time VerificationClass Data Sharing
Two Virtual Machines?Client VMReducing start-up time and memory footprint-client CL flagServer VMMaximum program execution speed-server CL flagAuto-detectionServer: >1 CPUs & >=2GB of physical memoryWin32 – always detected as clientMany 64bit OSes don’t have client VMs47
Just-In-Time CompilationEveryone knows about JIT!Hot code is compiled to nativeWhat is “hot”?Server VM – 10000 invocationsClient VM – 1500 invocationsUse -XX:CompileThreshold=# to changeMore invocations – better optimizationsLess invocations – shorter warmup time
Just-In-Time CompilationThe code is being optimized by the compilerComing soon…
Adaptive OptimizationAllows HotSpot to uncompile previously compiled codeMuch more aggressive, even speculative optimizations may be performedAnd rolled back if something goes wrong or new data gatheredE.g. classloading might invalidate inlining
Split Time VerificationJava suffers from long boot timeOne of the reasons is bytecode verificationValid flow controlType safetyVisibilityIn order to ease on the weak KVM, J2ME started performing part of the verification in compile timeIt’s good, so now it’s in Java SE 6 too
Class Data SharingHelps improve startup timeDuring JDK installation part of rt.jar is preloaded into shared memory file which is attached in runtimeNo need to reload and reverify those classes every time
Compiler Optimizations
Two Types of OptimizationsJava has two compilers:javac bytecode compilerHotSpot VM JIT compilerBoth implement similar optimizationsBytecode compiler is limitedDynamic linkingCan apply only static optimizations
WarningCaution! Don’t try this at home yourself!The source code you are about to see is not real!It’s pseudo assembly codeDon’t writesuch code!Source code should be readable and object-orientedBytecode will become performant automagically55
Optimization RulesMake the common case fastDon't worry about uncommon/infrequent caseDefer optimization decisionsUntil you have dataRevisit decisions if data warrants56
Null check EliminationJava is null-safe languagePointer can’t point to meaningless portion of memoryNull checks are added by the compiler, NullPointerException is thrownJVM’s profiler can eliminate those checks57
Example – Original Source58
Example – Null Check Elimination59
InliningLove Encapsulation?Getters and settersLove clean and simple code?Small methodsUse static code analysis?Small methodsNo penalty for using those!JIT brings the implementation of these methods into a containing methodThis optimization known as “Inlining”
InliningNot just about eliminating call overheadProvides optimizer with bigger blocksEnables other optimizationshoisting, dead code elimination, code motion, strength reduction61
InliningBut wait, all public non-final methods in Java are virtual!HotSpot examines the exact case in placeIn most cases there is only one implementation, which can be inlinedBut wait, more implementations may be loaded later!In such case HotSpot undoes the inliningSpeculative inliningBy default limited to 35 bytes of bytecodeUse -XX:MaxInlineSize=# to change
Example - Inlining63
Example – Source Code Revision64
Example – Source Code Revision65
Code HoistingHoist = to raise or liftSize optimizationEliminate duplicate code in method bodies by hoisting expressions or statementsDuplicate bytecode, not necessarily source code
Example – Code Hoisting67
Bounds Check EliminationJava promises automatic boundary checks for arraysException is thrownIf programmer checks the boundaries of its array by himself, the automatic check can be turned off
Example – Bounds Check Elimination69
Sub-Expression EliminationAvoids redundant memory access70
Loop UnrollingSome loops shouldn’t be loopsIn performance meaning, not code readabilityThose can be unrolled to set of statementsIf the boundaries are dynamic, partial unroll will occur
Ad

More Related Content

What's hot (20)

GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
Ludovic Poitou
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
Sergey Podolsky
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Jerry Kurian
 
JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
ihji
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
Jelastic Multi-Cloud PaaS
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java apps
Simon Ritter
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
Jelastic Multi-Cloud PaaS
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
Kai Koenig
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOM
Leon Chen
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
C2B2 Consulting
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
Azul Systems, Inc.
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
Haribabu Nandyal Padmanaban
 
G1 collector and tuning and Cassandra
G1 collector and tuning and CassandraG1 collector and tuning and Cassandra
G1 collector and tuning and Cassandra
Chris Lohfink
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
Azul Systems Inc.
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
Kelum Senanayake
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
 
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Monica Beckwith
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
Leon Chen
 
Understanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About ItUnderstanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About It
Azul Systems Inc.
 
-XX:+UseG1GC
-XX:+UseG1GC-XX:+UseG1GC
-XX:+UseG1GC
Jakub Kubrynski
 
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
Ludovic Poitou
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
Sergey Podolsky
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Jerry Kurian
 
JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
ihji
 
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaSMariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
MariaDB Auto-Clustering, Vertical and Horizontal Scaling within Jelastic PaaS
Jelastic Multi-Cloud PaaS
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java apps
Simon Ritter
 
Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...Running Java Applications inside Kubernetes with Nested Container Architectur...
Running Java Applications inside Kubernetes with Nested Container Architectur...
Jelastic Multi-Cloud PaaS
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
Kai Koenig
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOM
Leon Chen
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
C2B2 Consulting
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
Azul Systems, Inc.
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
Haribabu Nandyal Padmanaban
 
G1 collector and tuning and Cassandra
G1 collector and tuning and CassandraG1 collector and tuning and Cassandra
G1 collector and tuning and Cassandra
Chris Lohfink
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
Azul Systems Inc.
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
Kelum Senanayake
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
 
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Monica Beckwith
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
Leon Chen
 
Understanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About ItUnderstanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About It
Azul Systems Inc.
 

Similar to JVM Magic (20)

Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Anna Shymchenko
 
ZGC-SnowOne.pdf
ZGC-SnowOne.pdfZGC-SnowOne.pdf
ZGC-SnowOne.pdf
Monica Beckwith
 
Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
Daya Atapattu
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
aragozin
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
Jelastic Multi-Cloud PaaS
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
Haim Yadid
 
006 performance tuningandclusteradmin
006 performance tuningandclusteradmin006 performance tuningandclusteradmin
006 performance tuningandclusteradmin
Scott Miao
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Bruno Borges
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpot
jClarity
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Jelastic Multi-Cloud PaaS
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Mudit Gupta
 
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVM
jaganmohanreddyk
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
Kai Koenig
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
ColdFusionConference
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!
devObjective
 
Taming The JVM
Taming The JVMTaming The JVM
Taming The JVM
Matthew McCullough
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
Jeremy Leisy
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developers
Sanjoy Kumar Roy
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Mohammed Fazuluddin
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
Isuru Perera
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Anna Shymchenko
 
Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
Daya Atapattu
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
aragozin
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
Jelastic Multi-Cloud PaaS
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
Haim Yadid
 
006 performance tuningandclusteradmin
006 performance tuningandclusteradmin006 performance tuningandclusteradmin
006 performance tuningandclusteradmin
Scott Miao
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Bruno Borges
 
Low pause GC in HotSpot
Low pause GC in HotSpotLow pause GC in HotSpot
Low pause GC in HotSpot
jClarity
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Jelastic Multi-Cloud PaaS
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Mudit Gupta
 
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVM
jaganmohanreddyk
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
Kai Koenig
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!
devObjective
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
Jeremy Leisy
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developers
Sanjoy Kumar Roy
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
Isuru Perera
 
Ad

More from Baruch Sadogursky (20)

DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
Baruch Sadogursky
 
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
Baruch Sadogursky
 
Data driven devops as presented at QCon London 2018
Data driven devops as presented at QCon London 2018Data driven devops as presented at QCon London 2018
Data driven devops as presented at QCon London 2018
Baruch Sadogursky
 
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
Baruch Sadogursky
 
Java Puzzlers NG S03 a DevNexus 2018
Java Puzzlers NG S03 a DevNexus 2018Java Puzzlers NG S03 a DevNexus 2018
Java Puzzlers NG S03 a DevNexus 2018
Baruch Sadogursky
 
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Where the Helm are your binaries? as presented at Canada Kubernetes MeetupsWhere the Helm are your binaries? as presented at Canada Kubernetes Meetups
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Baruch Sadogursky
 
Data driven devops as presented at Codemash 2018
Data driven devops as presented at Codemash 2018Data driven devops as presented at Codemash 2018
Data driven devops as presented at Codemash 2018
Baruch Sadogursky
 
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
A Research Study into DevOps Bottlenecks as presented at Codemash 2018A Research Study into DevOps Bottlenecks as presented at Codemash 2018
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
Baruch Sadogursky
 
Best Practices for Managing Docker Versions as presented at JavaOne 2017
Best Practices for Managing Docker Versions as presented at JavaOne 2017Best Practices for Managing Docker Versions as presented at JavaOne 2017
Best Practices for Managing Docker Versions as presented at JavaOne 2017
Baruch Sadogursky
 
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Troubleshooting & Debugging Production Microservices in Kubernetes as present...Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
Baruch Sadogursky
 
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
Baruch Sadogursky
 
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
Baruch Sadogursky
 
Let’s Wing It: A Study in DevRel Strategy
 Let’s Wing It: A Study in DevRel Strategy Let’s Wing It: A Study in DevRel Strategy
Let’s Wing It: A Study in DevRel Strategy
Baruch Sadogursky
 
Log Driven First Class Customer Support at Scale
Log Driven First Class Customer Support at ScaleLog Driven First Class Customer Support at Scale
Log Driven First Class Customer Support at Scale
Baruch Sadogursky
 
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
Baruch Sadogursky
 
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Baruch Sadogursky
 
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
Baruch Sadogursky
 
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
Baruch Sadogursky
 
Data driven devops as presented at QCon London 2018
Data driven devops as presented at QCon London 2018Data driven devops as presented at QCon London 2018
Data driven devops as presented at QCon London 2018
Baruch Sadogursky
 
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
Baruch Sadogursky
 
Java Puzzlers NG S03 a DevNexus 2018
Java Puzzlers NG S03 a DevNexus 2018Java Puzzlers NG S03 a DevNexus 2018
Java Puzzlers NG S03 a DevNexus 2018
Baruch Sadogursky
 
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Where the Helm are your binaries? as presented at Canada Kubernetes MeetupsWhere the Helm are your binaries? as presented at Canada Kubernetes Meetups
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Baruch Sadogursky
 
Data driven devops as presented at Codemash 2018
Data driven devops as presented at Codemash 2018Data driven devops as presented at Codemash 2018
Data driven devops as presented at Codemash 2018
Baruch Sadogursky
 
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
A Research Study into DevOps Bottlenecks as presented at Codemash 2018A Research Study into DevOps Bottlenecks as presented at Codemash 2018
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
Baruch Sadogursky
 
Best Practices for Managing Docker Versions as presented at JavaOne 2017
Best Practices for Managing Docker Versions as presented at JavaOne 2017Best Practices for Managing Docker Versions as presented at JavaOne 2017
Best Practices for Managing Docker Versions as presented at JavaOne 2017
Baruch Sadogursky
 
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Troubleshooting & Debugging Production Microservices in Kubernetes as present...Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
Baruch Sadogursky
 
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
Baruch Sadogursky
 
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
Baruch Sadogursky
 
Let’s Wing It: A Study in DevRel Strategy
 Let’s Wing It: A Study in DevRel Strategy Let’s Wing It: A Study in DevRel Strategy
Let’s Wing It: A Study in DevRel Strategy
Baruch Sadogursky
 
Log Driven First Class Customer Support at Scale
Log Driven First Class Customer Support at ScaleLog Driven First Class Customer Support at Scale
Log Driven First Class Customer Support at Scale
Baruch Sadogursky
 
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
Baruch Sadogursky
 
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Baruch Sadogursky
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 

JVM Magic

  • 1. The JVM MagicBaruch SadogurskyConsultant & Architect, AlphaCSP
  • 2. AgendaIntroductionGC Magic 101General OptimizationsCompiler OptimizationsWhat can I do?Programming tipsJVM configuration flags2
  • 4. IntroductionIn the past, JVM was considered by many as Java Achilles’ heelInterpreter?!JVM team improved performance in 300 to 3000 timesJDK 1.6 compared to JDK 1.0Java is measured to be 50% to 100+% the speed of C and C++Jake2 vs Quake2How can it be?
  • 5. Java Virtual Machines ZooCEE-J Excelsior JETHewlett-PackardJ9 (IBM)JbedJblendJrockitMRJMicroJvmMS JVMOJVMPERCBlackdown JavaCVMGemstoneGolden Code DevelopmentIntentNovellNSIcomCrE-MEChaiVMHotSpotAegisVMApache HarmonyCACAODalvikIcedTeaIKVM.NETJamigaJamVMJaosJCJelatine JVMJESSICAJikes RVMJnodeJOPJuiceJupiterJXKaffeleJOSMika VMMysaifuNanoVMSableVMSquawk virtual machineSuperWabaTinyVMVMkit of Low Level Virtual MachineWonka VMXam5
  • 6. HotSpot Virtual MachineDeveloped by Longview Technologies back in 1999Contains:Class loaderBytecode interpreter2 Virtual machines7 Garbage collectors2 CompilersRuntime libraries
  • 7. HotSpot Virtual MachineConfigured by hundreds of –XX flagsReminder -X options are non-standard-XX options have specific system requirements for correct operationsBoth are subject to change without notice
  • 9. GC Is Slow?GC has bad performance reputationReduces throughputIntroduces pausesUnpredictableUncontrolledPerformance degradation is proportional to objects countJust give me the damn free() and malloc()! I’ll be just fine!Is it so?
  • 10. Generational CollectorsWeak generational hypothesisMost objects die young (AKA Infant mortality)Few old to young referencesGenerations: regions holding objects of different agesGC is done separately once a generation fillsDifferent GC algorithmsThe young (nursery) generationCollected by “Minor garbage collection”The old (tenured) generationCollected by “Minor garbage collection”
  • 11. GC Magic 101vsYoung is better than TenuredLet your objects die in young generationWhen possible and makes sense11
  • 12. GC Magic 10112vsSwapping is badApplication's memory footprint should not exceed the available physical memory
  • 13. GC Magic 10113vsChoose:Throughput (client)Low-pause (server)
  • 15. Tracking Collectors AlgorithmsMark-Sweep collectorMark phase marks each reachable objectSweep phase “sweeps” the heapNon marked objects reclaimed as garbageCopying collectorHeap is divided into two equal spacesWhen active space fills, live objects are copied to the unused spaceOnly live objects are examinedThe roles of the spaces are then flipped
  • 16. CompactionCompaction: The collector moves all live objects to the bottom of the heapRemaining memory is reclaimedReduces the cost of objects allocationNo potential fragmentationThe drawback is slower completion of GC
  • 17. The Young generationConsists of Eden + two survivor spaces Objects are initially allocated in EdenAll HotSpot young collectors are stop-the-world copying collectorsDone is parallel for parallel garbage collectorsCollections are relatively fast and proportional to number of live objects
  • 19. The Tenured generationObjects surviving several GC cycles, are promoted to the tenured generation Use -XX:MaxTenuringThreshold=# to changeCollectors algorithms used are variations of Mark-SweepMore space efficientCharacteristicsLower garbage densityBigger heap space Fewer GC cycles
  • 24. Garbage First (G1)New in JDK 1.6 u14 (May 29th)All memory is divided to 1MB bucketsCalculates objects liveness in bucketsDrops “dead” bucketsIf a bucket is not total garbage, it’s not droppedCollects the most garbage buckets firstPauses only on “mark”No sweepUser can provide pause time goalsActual seconds or Percentage of runtimeG1 records bucket collection time and can estimate how many buckets to collect during pause
  • 25. Garbage First (G1)Targets multi-process machines and large heapsG1 will be the long-term replacement for the CMS collectorUnlike CMS, compacts to battle fragmentationA bucket’s space is fully reclaimedBetter throughputPredictable pauses (high probability)Garbage left in buckets with high live ratioMay be collected later
  • 26. Benefits of G1No imbalance of young-tenured generationGenerations are only logical Generations are merely sets of buckets More predictable GC pausesParallelism and concurrency in collections No fragmentation due to compactionBetter heap utilization Better GC ergonomics
  • 27. Young GCs in G1Done using evacuation pausesStop-The-World parallel collectionsEvacuates surviving objects between sets of buckets
  • 28. Old GCs in G1Drops dead bucketsCalculates liveness info per bucketIdentifies best buckets for subsequent eviction pausesCollect them piggy-backed on young GCs
  • 30. GC ErgonomicsErgonomics goal is to provide good performance with little or no tuningBetter matches the needs of different application typesThe HotSpot, garbage collector and heap size are automatically chosenBased on OS, RAM and no# CPUServer Vs. Client class machineHints the characteristics of the application
  • 32. GC ErgonomicsWith the parallel collectors, one can specify performance goalsIn contrast to specifying the heap sizeImproves performance for large applicationsMax Pause Time GoalUse -XX:MaxGCPauseMillis=<N>Both generation separatelyOr: Average + VarianceNo pause time goal by default
  • 33. GC ErgonomicsThroughput GoalUse -XX:GCTimeRatio=<N>The ratio of GC Vs. application time is 1/(1+N)If N=19, GC time goal is 1/(1+19) or 5%Default N is 99, meaning GC time is 1% Minimum Footprint GoalPriority of goalsMaximum pause time goalThroughput goalMinimum footprint goal
  • 34. GC ErgonomicsPerformance goals may not be metPause time and throughput goals are somewhat contradictingThe pause time goal shrinks the generationThe throughput goal grows the generationStatistics are kept by the GCAdaptive to changes in application behavior
  • 36. Heap SizeThe larger the heap space, the betterFor both young and old generationLarger space: less frequent GCs, lower GC overhead, objects more likely to become garbageSmaller space: faster GCs (not always! see later)Sometimes max heap size is dictated by available memory and/or max space the JVM can addressYou have to find a good balance between young and old generation size
  • 37. Heap SizeMaximize the number of objects reclaimed in the young generationApplication's memory footprint should not exceed the available physical memorySwapping is badThe above apply to all our GCs37
  • 38. Heap Size-Xmx<size> : max heap sizeyoung generation + old generation-Xms<size> : initial heap sizeyoung generation + old generation-Xmn<size> : young generation size-XX:PermSize=<size> : permanent generation initial size-XX:MaxPermSize=<size> : permanent generation max size38
  • 39. Heap SizeWhen -Xms != -Xmx, heap growth or shrinking requires a Full GCSet -Xms to desired heap size Set –Xmx even higher “just in case”Even full GC is better than OOM crashSame for -XX:PermSize and -XX:MaxPermSizeSame for -XX:NewSize and-XX:MaxNewSize-Xmn Combines both39
  • 40. TenuringMeasure tenuring with - XX:+PrintTenuringDistributionAvoid tenuring for short or even medium-lived objects!Less promotion into the old generationLess frequent old GCsPromote long-lived objects ASAPYeah, conflict with previous bulletBetter copy more, than promote more-XX:TargetSurvivorRatio=<percent>, e.g., 50How much of the survivor space should be filledTypically leave extra space to deal with “spikes”40
  • 41. Permanent SpaceClasses aren’t unloaded by default-XX:+CMSClassUnloadingEnabled to enableClassloader should be collectedIt holds references to classesEach object holds reference to classloader41
  • 43. GC Statistics OptionsGC logging has extremely low / non-existent overheadIt’s very helpful when diagnosing production issuesEnable itIn production too!-XX:+PrintGCPrintGCDetailsPrintGCTimeStampsPrintTenuringDistributionShow this threshold and the ages of objects in the new generation43
  • 44. GC Is Slow? – The AnswersReduces throughputYou chooseIntroduces pausesYou chooseUnpredictableNot any moreUncontrolledConfigurablePerformance degradation is proportional to objects countNot trueJust give me the damn free() and malloc()! I’ll be just fine!Bad idea (see more later)
  • 46. HotSpot OptimizationsJIT CompilationCompiler OptimizationsGenerates more performant code that you could write in nativeAdaptive OptimizationSplit Time VerificationClass Data Sharing
  • 47. Two Virtual Machines?Client VMReducing start-up time and memory footprint-client CL flagServer VMMaximum program execution speed-server CL flagAuto-detectionServer: >1 CPUs & >=2GB of physical memoryWin32 – always detected as clientMany 64bit OSes don’t have client VMs47
  • 48. Just-In-Time CompilationEveryone knows about JIT!Hot code is compiled to nativeWhat is “hot”?Server VM – 10000 invocationsClient VM – 1500 invocationsUse -XX:CompileThreshold=# to changeMore invocations – better optimizationsLess invocations – shorter warmup time
  • 49. Just-In-Time CompilationThe code is being optimized by the compilerComing soon…
  • 50. Adaptive OptimizationAllows HotSpot to uncompile previously compiled codeMuch more aggressive, even speculative optimizations may be performedAnd rolled back if something goes wrong or new data gatheredE.g. classloading might invalidate inlining
  • 51. Split Time VerificationJava suffers from long boot timeOne of the reasons is bytecode verificationValid flow controlType safetyVisibilityIn order to ease on the weak KVM, J2ME started performing part of the verification in compile timeIt’s good, so now it’s in Java SE 6 too
  • 52. Class Data SharingHelps improve startup timeDuring JDK installation part of rt.jar is preloaded into shared memory file which is attached in runtimeNo need to reload and reverify those classes every time
  • 54. Two Types of OptimizationsJava has two compilers:javac bytecode compilerHotSpot VM JIT compilerBoth implement similar optimizationsBytecode compiler is limitedDynamic linkingCan apply only static optimizations
  • 55. WarningCaution! Don’t try this at home yourself!The source code you are about to see is not real!It’s pseudo assembly codeDon’t writesuch code!Source code should be readable and object-orientedBytecode will become performant automagically55
  • 56. Optimization RulesMake the common case fastDon't worry about uncommon/infrequent caseDefer optimization decisionsUntil you have dataRevisit decisions if data warrants56
  • 57. Null check EliminationJava is null-safe languagePointer can’t point to meaningless portion of memoryNull checks are added by the compiler, NullPointerException is thrownJVM’s profiler can eliminate those checks57
  • 59. Example – Null Check Elimination59
  • 60. InliningLove Encapsulation?Getters and settersLove clean and simple code?Small methodsUse static code analysis?Small methodsNo penalty for using those!JIT brings the implementation of these methods into a containing methodThis optimization known as “Inlining”
  • 61. InliningNot just about eliminating call overheadProvides optimizer with bigger blocksEnables other optimizationshoisting, dead code elimination, code motion, strength reduction61
  • 62. InliningBut wait, all public non-final methods in Java are virtual!HotSpot examines the exact case in placeIn most cases there is only one implementation, which can be inlinedBut wait, more implementations may be loaded later!In such case HotSpot undoes the inliningSpeculative inliningBy default limited to 35 bytes of bytecodeUse -XX:MaxInlineSize=# to change
  • 64. Example – Source Code Revision64
  • 65. Example – Source Code Revision65
  • 66. Code HoistingHoist = to raise or liftSize optimizationEliminate duplicate code in method bodies by hoisting expressions or statementsDuplicate bytecode, not necessarily source code
  • 67. Example – Code Hoisting67
  • 68. Bounds Check EliminationJava promises automatic boundary checks for arraysException is thrownIf programmer checks the boundaries of its array by himself, the automatic check can be turned off
  • 69. Example – Bounds Check Elimination69
  • 71. Loop UnrollingSome loops shouldn’t be loopsIn performance meaning, not code readabilityThose can be unrolled to set of statementsIf the boundaries are dynamic, partial unroll will occur
  • 72. Example – Loop Unrolling72
  • 74. Escape AnalysisEscape analysis is not optimizationIt is check for object not escaping local scopeE.g. created in private method, assigned to local variable and not returnedEscape analysis opens up possibilities for lots of optimizations
  • 75. Scalar ReplacementRemember the rule “new == always new object”?False!JVM can optimize away allocationsFields are hoisted into registersObject becomes unneededBut object creation is cheap!Yap, but GC is not so cheap…75
  • 76. Example – Source Code Revision76
  • 77. Example – Scalar Replacement77
  • 78. Example – Scalar Replacement78
  • 79. Lock CoarseningHotSpot merges adjacent synchronized blocks using the same lockThe compiler is allowed to moved statements into merged coarse blocks Tradeoff performance and responsivenessReduces instruction countBut locks are held longer
  • 80. Example – Source Code Revision80
  • 81. Example – Lock Coarsening81
  • 82. Lock ElisionA thread enters a lock that no other thread will synchronize onSynchronization has no effectCan be deducted using escape analysisSuch locks can be elidedElides 4 StringBuffer synchronized calls:
  • 83. Example - Lock Elision
  • 84. Constants FoldingTrivial optimizationHow many constants are there?More than you think!Inlining generates constantsUnrolling generates constantsEscape analysis generates constantsJIT determines what is constant in runtimeWhatever doesn’t change
  • 85. Constants FoldingLiterals foldingBefore: intfoo = 9*10;After: intfoo = 90;String folding or StringBuilder-ingBefore: String foo = "hi Joe " + (9*10);After: String foo = newStringBuilder().append("hi Joe ").append(9 * 10).toString();After: String foo = "hi Joe 90";
  • 87. Dead Code EliminationDead code - code that has no effect on the outcome of the program execution publicstaticvoid main(String[] args) {long start = System.nanoTime(); int result = 0; for (inti = 0; i < 10 * 1000 * 1000; i++) { result += Math.sqrt(i); } long duration = (System.nanoTime() - start) / 1000000; System.out.format("Test duration: %d (ms) %n", duration);}
  • 88. OSR - On Stack ReplacementNormally code is switched from interpretation to native in heap contextBefore entering methodOSR - switch from interpretation to compiled code in local contextIn the middle of a method callJVM tracks code block execution count Less optimizationsMay prevent bound check elimination and loop unrolling
  • 91. Programming & Tuning Tips 91How Can I Help?Just write good quality Java codeObject OrientationPolymorphismAbstractionEncapsulationDRYKISSLet the HotSpot optimize
  • 92. How Can I Help?final keywordFor fields:Allows cachingAllows lock coarseningFor methods:Simplifies Inlining decisionsImmutable objects die younger93
  • 93. JVM tuning tipsReminder: -XX options are non standardAdded for HotSpot development purposesMostly tested on Solaris 10Platform dependentSome options may contradict each otherKnow and experiment with these options 94
  • 95. ReferencesThe HotSpot Home PageJava HotSpot VM OptionsDynamic compilation and performance measurementUrban performance legends, revisitedSynchronization optimizations in MustangRobust Java benchmarkingGarbage Collection Tuning96
  • 96. ReferencesJavaOne 2009 Sessions:Garbage Collection Tuning in the Java HotSpot™ Virtual MachineUnder the Hood: Inside a High-Performance JVM™ MachinePractical Lessons in Memory AnalysisDebugging Your Production JVM™ MachineInside Out: A Modern Virtual Machine Revealed97
  • 97. Thank you for your attention Thanks to Ori Dar!