SlideShare uma empresa Scribd logo
1 de 331
Baixar para ler offline
©2011 Azul Systems, Inc. 
Understanding Java 
Garbage Collection 
and what you can do about it 
Ivan Krylov, Azul Systems 
Slides Courtesy Gil Tene, CTO & co-Founder, Azul Systems
©2013 Azul Systems, Inc. 
About me: Ivan Krylov
©2013 Azul Systems, Inc. 
About me: Ivan Krylov 
Sr. engineer @Azul Systems
©2013 Azul Systems, Inc. 
About me: Ivan Krylov 
Sr. engineer @Azul Systems 
Work mainly on JVM Runtime
©2013 Azul Systems, Inc. 
About me: Ivan Krylov 
Sr. engineer @Azul Systems 
Work mainly on JVM Runtime 
Previously worked on a JIT compiler for HSAIL stack
©2013 Azul Systems, Inc. 
About me: Ivan Krylov 
Sr. engineer @Azul Systems 
Work mainly on JVM Runtime 
Previously worked on a JIT compiler for HSAIL stack 
Previously worked at Sun Microsystems / Oracle at the 
Hotspot Devteam - jvm runtime
©2013 Azul Systems, Inc. 
About me: Ivan Krylov 
Sr. engineer @Azul Systems 
Work mainly on JVM Runtime 
Previously worked on a JIT compiler for HSAIL stack 
Previously worked at Sun Microsystems / Oracle at the 
Hotspot Devteam - jvm runtime 
Ph.D. (2004) in Appl. Math.
©2011 Azul Systems, Inc. 
This Talk’s Purpose / Goals
©2011 Azul Systems, Inc. 
This Talk’s Purpose / Goals 
This talk is focused on GC education
©2011 Azul Systems, Inc. 
This Talk’s Purpose / Goals 
This talk is focused on GC education 
This is not a “how to use flags to tune a collector” talk
©2011 Azul Systems, Inc. 
This Talk’s Purpose / Goals 
This talk is focused on GC education 
This is not a “how to use flags to tune a collector” talk 
This is a talk about how the “GC machine” works
©2011 Azul Systems, Inc. 
This Talk’s Purpose / Goals 
This talk is focused on GC education 
This is not a “how to use flags to tune a collector” talk 
This is a talk about how the “GC machine” works 
The “Azul makes the world’s greatest GC” stuff will/ 
may come at the end …
©2011 Azul Systems, Inc. 
High level agenda
©2011 Azul Systems, Inc. 
High level agenda 
GC fundamentals and key mechanisms
©2011 Azul Systems, Inc. 
High level agenda 
GC fundamentals and key mechanisms 
Some GC terminology & metrics
©2011 Azul Systems, Inc. 
High level agenda 
GC fundamentals and key mechanisms 
Some GC terminology & metrics 
Classifying current commercially available collectors
©2011 Azul Systems, Inc. 
High level agenda 
GC fundamentals and key mechanisms 
Some GC terminology & metrics 
Classifying current commercially available collectors 
Why Stop-The-World is a problem
©2011 Azul Systems, Inc. 
High level agenda 
GC fundamentals and key mechanisms 
Some GC terminology & metrics 
Classifying current commercially available collectors 
Why Stop-The-World is a problem 
The C4 collector: What a solution to STW looks like...
©2011 Azul Systems, Inc. 
Why should you understand 
(at least a little) how GC works?
©2011 Azul Systems, Inc. 
The story of the good little architect
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
©2011 Azul Systems, Inc. 
*We have since made reference processing fully concurrent...
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
*We have since made reference processing fully concurrent... 
Every single class written in the project had a finalizer 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
*We have since made reference processing fully concurrent... 
Every single class written in the project had a finalizer 
The only work the finalizers did was nulling every reference field 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
*We have since made reference processing fully concurrent... 
Every single class written in the project had a finalizer 
The only work the finalizers did was nulling every reference field 
The right discipline for a C++ ref-counting environment 
©2011 Azul Systems, Inc.
The story of the good little architect 
A good architect must, first and foremost, be able to 
impose their architectural choices on the project... 
Early in Azul’s concurrent collector days, we encountered 
an application exhibiting 18 second pauses 
Upon investigation, we found the collector was performing 10s of 
millions of object finalizations per GC cycle 
*We have since made reference processing fully concurrent... 
Every single class written in the project had a finalizer 
The only work the finalizers did was nulling every reference field 
The right discipline for a C++ ref-counting environment 
The wrong discipline for a precise garbage collected environment 
©2011 Azul Systems, Inc.
©2011 Azul Systems, Inc. 
Much of what People seem to “know” 
about Garbage Collection is wrong
Much of what People seem to “know” 
about Garbage Collection is wrong 
In many cases, it’s much better than you may think 
GC is extremely efficient. Much more so that malloc() 
Dead objects cost nothing to collect 
GC will find all the dead objects (including cyclic graphs) 
... 
©2011 Azul Systems, Inc.
Much of what People seem to “know” 
about Garbage Collection is wrong 
In many cases, it’s much better than you may think 
GC is extremely efficient. Much more so that malloc() 
Dead objects cost nothing to collect 
GC will find all the dead objects (including cyclic graphs) 
... 
In many cases, it’s much worse than you may think 
Yes, it really will stop for ~1 sec per live GB (except with Zing) 
No, GC does not mean you can’t have memory leaks 
No, those pauses you eliminated from your 20 minute test are 
not gone 
... 
©2011 Azul Systems, Inc.
©2011 Azul Systems, Inc. 
Memory use 
How many of you use heap sizes of: 
F more than ½ GB? 
F more than 1 GB? 
F more than 2 GB? 
F more than 4 GB? 
F more than 10 GB? 
F more than 20 GB? 
F more than 50 GB? 
F more than 100 GB?
©2011 Azul Systems, Inc. 
Memory use 
How many of you use heap sizes of: 
F more than ½ GB? 
F more than 1 GB? 
F more than 2 GB? 
F more than 4 GB? 
F more than 10 GB? 
F more than 20 GB? 
F more than 50 GB? 
F more than 100 GB?
©2011 Azul Systems, Inc. 
Some GC Terminology
©2011 Azul Systems, Inc. 
A Basic Terminology example: 
What is a concurrent collector?
©2011 Azul Systems, Inc. 
A Basic Terminology example: 
What is a concurrent collector? 
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution
©2011 Azul Systems, Inc. 
A Basic Terminology example: 
What is a concurrent collector? 
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution 
A Parallel Collector uses multiple CPUs to perform 
garbage collection
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution 
A Parallel Collector uses multiple CPUs to perform 
garbage collection 
©2011 Azul Systems, Inc. 
Classifying a collector’s operation
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution 
A Parallel Collector uses multiple CPUs to perform 
garbage collection 
©2011 Azul Systems, Inc. 
Classifying a collector’s operation 
A Stop-the-World collector performs garbage 
collection while the application is completely stopped
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution 
A Parallel Collector uses multiple CPUs to perform 
garbage collection 
A Stop-the-World collector performs garbage 
collection while the application is completely stopped 
©2011 Azul Systems, Inc. 
Classifying a collector’s operation 
An Incremental collector performs a garbage collection 
operation or phase as a series of smaller discrete 
operations with (potentially long) gaps in between
A Concurrent Collector performs garbage collection 
work concurrently with the application’s own execution 
A Parallel Collector uses multiple CPUs to perform 
garbage collection 
A Stop-the-World collector performs garbage 
collection while the application is completely stopped 
©2011 Azul Systems, Inc. 
Classifying a collector’s operation 
An Incremental collector performs a garbage collection 
operation or phase as a series of smaller discrete 
operations with (potentially long) gaps in between 
Mostly means sometimes it isn’t (usually means a 
different fall back mechanism exists)
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not 
A Collector is Precise if it can fully identify and 
process all object references at the time of collection 
A collector MUST be precise in order to move objects 
The COMPILERS need to produce a lot of information (oopmaps)
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not 
A Collector is Precise if it can fully identify and 
process all object references at the time of collection 
A collector MUST be precise in order to move objects 
The COMPILERS need to produce a lot of information (oopmaps) 
All commercial server JVMs use precise collectors 
All commercial server JVMs use some form of a moving collector
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not 
A Collector is Precise if it can fully identify and 
process all object references at the time of collection 
A collector MUST be precise in order to move objects 
The COMPILERS need to produce a lot of information (oopmaps) 
All commercial server JVMs use precise collectors 
All commercial server JVMs use some form of a moving collector
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not 
A Collector is Precise if it can fully identify and 
process all object references at the time of collection 
A collector MUST be precise in order to move objects 
The COMPILERS need to produce a lot of information (oopmaps) 
All commercial server JVMs use precise collectors 
All commercial server JVMs use some form of a moving collector
©2011 Azul Systems, Inc. 
Precise vs. Conservative Collection 
A Collector is Conservative if it is unaware of some 
object references at collection time, or is unsure 
about whether a field is a reference or not 
A Collector is Precise if it can fully identify and 
process all object references at the time of collection 
A collector MUST be precise in order to move objects 
The COMPILERS need to produce a lot of information (oopmaps) 
All commercial server JVMs use precise collectors 
All commercial server JVMs use some form of a moving collector
©2011 Azul Systems, Inc. 
Safepoints
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization)
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization) 
“Bringing a thread to a safepoint” is the act of getting a 
thread to reach a safepoint and not execute past it
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization) 
“Bringing a thread to a safepoint” is the act of getting a 
thread to reach a safepoint and not execute past it 
Close to, but not exactly the same as “stop at a safepoint”
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization) 
“Bringing a thread to a safepoint” is the act of getting a 
thread to reach a safepoint and not execute past it 
Close to, but not exactly the same as “stop at a safepoint” 
e.g. JNI: you can keep running in, but not past the safepoint
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization) 
“Bringing a thread to a safepoint” is the act of getting a 
thread to reach a safepoint and not execute past it 
Close to, but not exactly the same as “stop at a safepoint” 
e.g. JNI: you can keep running in, but not past the safepoint 
Safepoint opportunities are (or should be) frequent
©2011 Azul Systems, Inc. 
Safepoints 
A GC Safepoint is a point or range in a thread’s 
execution where the collector can identify all the 
references in that thread’s execution stack 
“Safepoint” and “GC Safepoint” are often used interchangeably 
But there are other types of safepoints, including ones that require 
more information than a GC safepoint does (e.g. deoptimization) 
“Bringing a thread to a safepoint” is the act of getting a 
thread to reach a safepoint and not execute past it 
Close to, but not exactly the same as “stop at a safepoint” 
e.g. JNI: you can keep running in, but not past the safepoint 
Safepoint opportunities are (or should be) frequent 
In a Global Safepoint all threads are at a Safepoint
©2011 Azul Systems, Inc. 
Useful terms for discussing 
Mutator 
Your program… 
Parallel 
garbage collection 
Can use multiple CPUs 
Concurrent 
Runs concurrently with program 
Pause 
A time duration in which the 
mutator is not running any code 
Stop-The-World (STW) 
Something that is done in a pause 
Monolithic Stop-The-World 
Something that must be done in 
it’s entirety in a single pause 
Generational 
Collects young objects and long lived 
objects separately. 
Promotion 
Allocation into old generation 
Marking 
Finding all live objects 
Sweeping 
Locating the dead objects 
Compaction 
Defragments heap 
Moves objects in memory 
Remaps all affected references 
Frees contiguous memory regions
©2011 Azul Systems, Inc. 
Useful terms for discussing 
Mutator 
Your program… 
Parallel 
garbage collection 
Can use multiple CPUs 
Concurrent 
Runs concurrently with program 
Pause 
A time duration in which the 
mutator is not running any code 
Stop-The-World (STW) 
Something that is done in a pause 
Monolithic Stop-The-World 
Something that must be done in 
it’s entirety in a single pause 
Generational 
Collects young objects and long lived 
objects separately. 
Promotion 
Allocation into old generation 
Marking 
Finding all live objects 
Sweeping 
Locating the dead objects 
Compaction 
Defragments heap 
Moves objects in memory 
Remaps all affected references 
Frees contiguous memory regions
©2011 Azul Systems, Inc. 
Useful metrics for discussing garbage 
Heap population (aka Live set) 
How much of your heap is alive 
Allocation rate 
How fast you allocate 
Mutation rate 
How fast your program updates 
references in memory 
Heap Shape 
The shape of the live object graph 
* Hard to quantify as a metric... 
Object Lifetime 
How long objects live 
collection 
Cycle time 
How long it takes the collector to free 
up memory 
Marking time 
How long it takes the collector to find 
all live objects 
Sweep time 
How long it takes to locate dead 
objects 
* Relevant for Mark-Sweep 
Compaction time 
How long it takes to free up memory 
by relocating objects 
* Relevant for Mark-Compact
©2011 Azul Systems, Inc. 
Useful metrics for discussing garbage 
Heap population (aka Live set) 
How much of your heap is alive 
Allocation rate 
How fast you allocate 
Mutation rate 
How fast your program updates 
references in memory 
Heap Shape 
The shape of the live object graph 
* Hard to quantify as a metric... 
Object Lifetime 
How long objects live 
collection 
Cycle time 
How long it takes the collector to free 
up memory 
Marking time 
How long it takes the collector to find 
all live objects 
Sweep time 
How long it takes to locate dead 
objects 
* Relevant for Mark-Sweep 
Compaction time 
How long it takes to free up memory 
by relocating objects 
* Relevant for Mark-Compact
©2011 Azul Systems, Inc. 
Useful metrics for discussing garbage 
Heap population (aka Live set) 
How much of your heap is alive 
Allocation rate 
How fast you allocate 
Mutation rate 
How fast your program updates 
references in memory 
Heap Shape 
The shape of the live object graph 
* Hard to quantify as a metric... 
Object Lifetime 
How long objects live 
collection 
Cycle time 
How long it takes the collector to free 
up memory 
Marking time 
How long it takes the collector to find 
all live objects 
Sweep time 
How long it takes to locate dead 
objects 
* Relevant for Mark-Sweep 
Compaction time 
How long it takes to free up memory 
by relocating objects 
* Relevant for Mark-Compact
©2011 Azul Systems, Inc. 
Useful metrics for discussing garbage 
Heap population (aka Live set) 
How much of your heap is alive 
Allocation rate 
How fast you allocate 
Mutation rate 
How fast your program updates 
references in memory 
Heap Shape 
The shape of the live object graph 
* Hard to quantify as a metric... 
Object Lifetime 
How long objects live 
collection 
Cycle time 
How long it takes the collector to free 
up memory 
Marking time 
How long it takes the collector to find 
all live objects 
Sweep time 
How long it takes to locate dead 
objects 
* Relevant for Mark-Sweep 
Compaction time 
How long it takes to free up memory 
by relocating objects 
* Relevant for Mark-Compact
©2011 Azul Systems, Inc. 
Useful metrics for discussing garbage 
Heap population (aka Live set) 
How much of your heap is alive 
Allocation rate 
How fast you allocate 
Mutation rate 
How fast your program updates 
references in memory 
Heap Shape 
The shape of the live object graph 
* Hard to quantify as a metric... 
Object Lifetime 
How long objects live 
collection 
Cycle time 
How long it takes the collector to free 
up memory 
Marking time 
How long it takes the collector to find 
all live objects 
Sweep time 
How long it takes to locate dead 
objects 
* Relevant for Mark-Sweep 
Compaction time 
How long it takes to free up memory 
by relocating objects 
* Relevant for Mark-Compact
©2011 Azul Systems, Inc. 
What’s common to all 
precise GC mechanisms?
©2011 Azul Systems, Inc. 
What’s common to all 
precise GC mechanisms? 
Identify the live objects in the memory heap
©2011 Azul Systems, Inc. 
What’s common to all 
precise GC mechanisms? 
Identify the live objects in the memory heap 
Reclaim resources held by dead objects
©2011 Azul Systems, Inc. 
What’s common to all 
precise GC mechanisms? 
Identify the live objects in the memory heap 
Reclaim resources held by dead objects 
Periodically relocate live objects
©2011 Azul Systems, Inc. 
What’s common to all 
precise GC mechanisms? 
Identify the live objects in the memory heap 
Reclaim resources held by dead objects 
Periodically relocate live objects 
Examples: 
Mark/Sweep/Compact (common for Old Generations) 
Copying collector (common for Young Generations)
©2011 Azul Systems, Inc. 
Mark (aka “Trace”)
©2011 Azul Systems, Inc. 
Mark (aka “Trace”) 
Start from “roots” (thread stacks, statics, etc.)
©2011 Azul Systems, Inc. 
Mark (aka “Trace”) 
Start from “roots” (thread stacks, statics, etc.) 
“Paint” anything you can reach as “live”
©2011 Azul Systems, Inc. 
Mark (aka “Trace”) 
Start from “roots” (thread stacks, statics, etc.) 
“Paint” anything you can reach as “live” 
At the end of a mark pass: 
all reachable objects will be marked “live” 
all non-reachable objects will be marked 
“dead” (aka “non-live”).
©2011 Azul Systems, Inc. 
Mark (aka “Trace”) 
Start from “roots” (thread stacks, statics, etc.) 
“Paint” anything you can reach as “live” 
At the end of a mark pass: 
all reachable objects will be marked “live” 
all non-reachable objects will be marked 
“dead” (aka “non-live”). 
Note: work is generally linear to “live set”
©2011 Azul Systems, Inc. 
Sweep
©2011 Azul Systems, Inc. 
Sweep 
Scan through the heap, identify “dead” objects and 
track them somehow 
(usually in some form of free list)
©2011 Azul Systems, Inc. 
Sweep 
Scan through the heap, identify “dead” objects and 
track them somehow 
(usually in some form of free list) 
Note: work is generally linear to heap size
©2011 Azul Systems, Inc. 
Compact
©2011 Azul Systems, Inc. 
Compact 
Over time, heap will get “swiss cheesed”: contiguous 
dead space between objects may not be large 
enough to fit new objects (aka “fragmentation”)
©2011 Azul Systems, Inc. 
Compact 
Over time, heap will get “swiss cheesed”: contiguous 
dead space between objects may not be large 
enough to fit new objects (aka “fragmentation”) 
Compaction moves live objects together to reclaim 
contiguous empty space (aka “relocate”)
©2011 Azul Systems, Inc. 
Compact 
Over time, heap will get “swiss cheesed”: contiguous 
dead space between objects may not be large 
enough to fit new objects (aka “fragmentation”) 
Compaction moves live objects together to reclaim 
contiguous empty space (aka “relocate”) 
Compaction has to correct all object references to 
point to new object locations (aka “remap”)
©2011 Azul Systems, Inc. 
Compact 
Over time, heap will get “swiss cheesed”: contiguous 
dead space between objects may not be large 
enough to fit new objects (aka “fragmentation”) 
Compaction moves live objects together to reclaim 
contiguous empty space (aka “relocate”) 
Compaction has to correct all object references to 
point to new object locations (aka “remap”) 
Remap scan must cover all references that could 
possibly point to relocated objects
©2011 Azul Systems, Inc. 
Compact 
Over time, heap will get “swiss cheesed”: contiguous 
dead space between objects may not be large 
enough to fit new objects (aka “fragmentation”) 
Compaction moves live objects together to reclaim 
contiguous empty space (aka “relocate”) 
Compaction has to correct all object references to 
point to new object locations (aka “remap”) 
Remap scan must cover all references that could 
possibly point to relocated objects 
Note: work is generally linear to “live set”
©2011 Azul Systems, Inc. 
Copy
©2011 Azul Systems, Inc. 
Copy 
A copying collector moves all lives objects from a 
“from” space to a “to” space & reclaims “from” space
©2011 Azul Systems, Inc. 
Copy 
A copying collector moves all lives objects from a 
“from” space to a “to” space & reclaims “from” space 
At start of copy, all objects are in “from” space and 
all references point to “from” space.
©2011 Azul Systems, Inc. 
Copy 
A copying collector moves all lives objects from a 
“from” space to a “to” space & reclaims “from” space 
At start of copy, all objects are in “from” space and 
all references point to “from” space. 
Start from “root” references, copy any reachable 
object to “to” space, correcting references as we go
©2011 Azul Systems, Inc. 
Copy 
A copying collector moves all lives objects from a 
“from” space to a “to” space & reclaims “from” space 
At start of copy, all objects are in “from” space and 
all references point to “from” space. 
Start from “root” references, copy any reachable 
object to “to” space, correcting references as we go 
At end of copy, all objects are in “to” space, and all 
references point to “to” space
©2011 Azul Systems, Inc. 
Copy 
A copying collector moves all lives objects from a 
“from” space to a “to” space & reclaims “from” space 
At start of copy, all objects are in “from” space and 
all references point to “from” space. 
Start from “root” references, copy any reachable 
object to “to” space, correcting references as we go 
At end of copy, all objects are in “to” space, and all 
references point to “to” space 
Note: work generally linear to “live set”
Mark/Sweep/Compact, Copy, Mark/Compact 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
Mark/Sweep/Compact only requires 1x (plus some) 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
Mark/Sweep/Compact only requires 1x (plus some) 
Copy and Mark/Compact are linear only to live set 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
Mark/Sweep/Compact only requires 1x (plus some) 
Copy and Mark/Compact are linear only to live set 
Mark/Sweep/Compact linear (in sweep) to heap size 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
Mark/Sweep/Compact only requires 1x (plus some) 
Copy and Mark/Compact are linear only to live set 
Mark/Sweep/Compact linear (in sweep) to heap size 
Mark/Sweep/(Compact) may be able to avoid some 
moving work 
©2011 Azul Systems, Inc.
Mark/Sweep/Compact, Copy, Mark/Compact 
Copy requires 2x the max. live set to be reliable 
Mark/Sweep/Compact only requires 1x (plus some) 
Copy and Mark/Compact are linear only to live set 
Mark/Sweep/Compact linear (in sweep) to heap size 
Mark/Sweep/(Compact) may be able to avoid some 
moving work 
Copying is [typically] “monolithic” 
©2011 Azul Systems, Inc.
©2011 Azul Systems, Inc. 
Generational Collection 
Young Generation 
Old Generation
©2011 Azul Systems, Inc. 
Generational Collection 
Young Generation 
Old Generation 
new 
object
©2011 Azul Systems, Inc. 
Generational Collection 
Young Generation 
Old Generation 
new 
object 
very large 
new object
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
Starting 1st young gen collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
After 1st young gen collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
Starting 2nd young gen collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
After 2nd young gen collection “From” 
Old Generation 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
After Nth young gen collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
Starting N+1 st young gen 
collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
Starting N+1 st young gen 
collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space 
Starting N+1 st young gen 
collection
©2011 Azul Systems, Inc. 
Copy Collection 
Old Generation 
“From” 
space 
“To” 
space
©2011 Azul Systems, Inc. 
Generational Collection
©2011 Azul Systems, Inc. 
Generational Collection 
Weak Generational Hypothesis; “most objects die young”
©2011 Azul Systems, Inc. 
Generational Collection 
Weak Generational Hypothesis; “most objects die young” 
Focus collection efforts on young generation: 
Use a moving collector: work is linear to the live set 
The live set in the young generation is a small % of the space 
Promote objects that live long enough to older generations
©2011 Azul Systems, Inc. 
Generational Collection 
Weak Generational Hypothesis; “most objects die young” 
Focus collection efforts on young generation: 
Use a moving collector: work is linear to the live set 
The live set in the young generation is a small % of the space 
Promote objects that live long enough to older generations 
Only collect older generations as they fill up 
“Generational filter” reduces rate of allocation into older generations
©2011 Azul Systems, Inc. 
Generational Collection 
Weak Generational Hypothesis; “most objects die young” 
Focus collection efforts on young generation: 
Use a moving collector: work is linear to the live set 
The live set in the young generation is a small % of the space 
Promote objects that live long enough to older generations 
Only collect older generations as they fill up 
“Generational filter” reduces rate of allocation into older generations 
Tends to be (order of magnitude) more efficient 
Great way to keep up with high allocation rate 
Practical necessity for keeping up with processor throughput
©2011 Azul Systems, Inc. 
Marking in Young gen problem 
Young Generation 
Old Generation
©2011 Azul Systems, Inc. 
Marking in Young gen problem 
Young Generation 
Old Generation 
Root set
©2011 Azul Systems, Inc. 
Marking in Young gen problem 
Young Generation 
Old Generation 
Root set
©2011 Azul Systems, Inc. 
Marking in Young gen problem 
Young Generation 
Old Generation 
Root set
©2011 Azul Systems, Inc. 
Marking in Young gen solution 
Young Generation 
Old Generation
©2011 Azul Systems, Inc. 
Marking in Young gen solution 
Young Generation 
Old Generation
©2011 Azul Systems, Inc. 
Generational Collection
©2011 Azul Systems, Inc. 
Generational Collection 
Requires a “Remembered set”: a way to track all 
references into the young generation from the outside
©2011 Azul Systems, Inc. 
Generational Collection 
Requires a “Remembered set”: a way to track all 
references into the young generation from the outside 
Remembered set is also part of “roots” for young 
generation collection
©2011 Azul Systems, Inc. 
Generational Collection 
Requires a “Remembered set”: a way to track all 
references into the young generation from the outside 
Remembered set is also part of “roots” for young 
generation collection 
No need for 2x the live set: Can “spill over” to old gen
©2011 Azul Systems, Inc. 
Generational Collection 
Requires a “Remembered set”: a way to track all 
references into the young generation from the outside 
Remembered set is also part of “roots” for young 
generation collection 
No need for 2x the live set: Can “spill over” to old gen 
Usually want to keep surviving objects in young 
generation for a while before promoting them to the 
old generation 
Immediate promotion can significantly reduce gen. filter efficiency 
Waiting too long to promote can eliminate generational benefits
©2011 Azul Systems, Inc. 
How does the remembered set work?
How does the remembered set work? 
Generational collectors require a “Remembered set”: a 
way to track all references into the young generation 
from the outside 
©2011 Azul Systems, Inc.
How does the remembered set work? 
Generational collectors require a “Remembered set”: a 
way to track all references into the young generation 
from the outside 
Each store of a NewGen reference into and OldGen 
object needs to be intercepted and tracked 
©2011 Azul Systems, Inc.
How does the remembered set work? 
Generational collectors require a “Remembered set”: a 
way to track all references into the young generation 
from the outside 
Each store of a NewGen reference into and OldGen 
object needs to be intercepted and tracked 
Common technique: “Card Marking” 
A bit (or byte) indicating a word (or region) in OldGen is “suspect” 
©2011 Azul Systems, Inc.
How does the remembered set work? 
Generational collectors require a “Remembered set”: a 
way to track all references into the young generation 
from the outside 
Each store of a NewGen reference into and OldGen 
object needs to be intercepted and tracked 
Common technique: “Card Marking” 
A bit (or byte) indicating a word (or region) in OldGen is “suspect” 
Write barrier used to track references 
Common technique (e.g. HotSpot): blind stores on reference write 
Variants: precise vs. imprecise card marking, conditional vs. non-conditional 
©2011 Azul Systems, Inc.
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMS
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMS 
Young generation usually uses a copying collector
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMS 
Young generation usually uses a copying collector 
Young generation is usually monolithic, stop-the-world
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMS 
Young generation usually uses a copying collector 
Young generation is usually monolithic, stop-the-world 
Old generation usually uses Mark/Sweep/Compact
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMS 
Young generation usually uses a copying collector 
Young generation is usually monolithic, stop-the-world 
Old generation usually uses Mark/Sweep/Compact 
Old generation may be STW, or Concurrent, or 
mostly-Concurrent, or Incremental-STW, or mostly- 
Incremental-STW
©2011 Azul Systems, Inc. 
Empty memory 
and CPU/throughput
CPU% 
Heap size 
Heap size vs. 
GC CPU %
CPU% 
100% 
Heap size 
Live set 
Heap size vs. 
GC CPU %
CPU% 
100% 
Heap size 
Live set 
Heap size vs. 
GC CPU %
©2011 Azul Systems, Inc. 
Two Intuitive limits
©2011 Azul Systems, Inc. 
Two Intuitive limits 
If we had exactly 1 byte of empty memory at all 
times, the collector would have to work “very hard”, 
and GC would take 100% of the CPU time
©2011 Azul Systems, Inc. 
Two Intuitive limits 
If we had exactly 1 byte of empty memory at all 
times, the collector would have to work “very hard”, 
and GC would take 100% of the CPU time 
If we had infinite empty memory, we would never have 
to collect, and GC would take 0% of the CPU time
©2011 Azul Systems, Inc. 
Two Intuitive limits 
If we had exactly 1 byte of empty memory at all 
times, the collector would have to work “very hard”, 
and GC would take 100% of the CPU time 
If we had infinite empty memory, we would never have 
to collect, and GC would take 0% of the CPU time 
GC CPU % will follow a rough 1/x curve between these 
two limit points, dropping as the amount of memory 
increases.
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power)
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power) 
The amount of empty memory in the heap is the 
dominant factor controlling the amount of GC work
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power) 
The amount of empty memory in the heap is the 
dominant factor controlling the amount of GC work 
For both Copy and Mark/Compact collectors, the 
amount of work per cycle is linear to live set
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power) 
The amount of empty memory in the heap is the 
dominant factor controlling the amount of GC work 
For both Copy and Mark/Compact collectors, the 
amount of work per cycle is linear to live set 
The amount of memory recovered per cycle is equal to 
the amount of unused memory (heap size - live set)
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power) 
The amount of empty memory in the heap is the 
dominant factor controlling the amount of GC work 
For both Copy and Mark/Compact collectors, the 
amount of work per cycle is linear to live set 
The amount of memory recovered per cycle is equal to 
the amount of unused memory (heap size - live set) 
The collector has to perform a GC cycle when the 
empty memory runs out
©2011 Azul Systems, Inc. 
Empty memory needs 
(empty memory == CPU power) 
The amount of empty memory in the heap is the 
dominant factor controlling the amount of GC work 
For both Copy and Mark/Compact collectors, the 
amount of work per cycle is linear to live set 
The amount of memory recovered per cycle is equal to 
the amount of unused memory (heap size - live set) 
The collector has to perform a GC cycle when the 
empty memory runs out 
A Copy or Mark/Compact collector’s efficiency doubles 
with every doubling of the empty memory
©2011 Azul Systems, Inc. 
What empty memory controls
©2011 Azul Systems, Inc. 
What empty memory controls 
Empty memory controls efficiency (amount of collector 
work needed per amount of application work 
performed)
©2011 Azul Systems, Inc. 
What empty memory controls 
Empty memory controls efficiency (amount of collector 
work needed per amount of application work 
performed) 
Empty memory controls the frequency of pauses (if 
the collector performs any Stop-the-world operations)
©2011 Azul Systems, Inc. 
What empty memory controls 
Empty memory controls efficiency (amount of collector 
work needed per amount of application work 
performed) 
Empty memory controls the frequency of pauses (if 
the collector performs any Stop-the-world operations) 
Empty memory DOES NOT control pause times (only 
their frequency)
©2011 Azul Systems, Inc. 
What empty memory controls 
Empty memory controls efficiency (amount of collector 
work needed per amount of application work 
performed) 
Empty memory controls the frequency of pauses (if 
the collector performs any Stop-the-world operations) 
Empty memory DOES NOT control pause times (only 
their frequency) 
In Mark/Sweep/Compact collectors that pause for 
sweeping, more empty memory means less frequent but 
LARGER pauses
©2011 Azul Systems, Inc. 
Some non monolithic-STW stuff
©2011 Azul Systems, Inc. 
Concurrent Marking
©2011 Azul Systems, Inc. 
Concurrent Marking 
Mark all reachable objects as “live”, but object graph 
is “mutating” under us.
©2011 Azul Systems, Inc. 
Concurrent Marking 
Mark all reachable objects as “live”, but object graph 
is “mutating” under us. 
Classic concurrent marking race: mutator may move 
reference that has not yet been seen by the marker 
into an object that has already been visited 
If not intercepted or prevented in some way, will corrupt the heap
©2011 Azul Systems, Inc. 
Concurrent Marking 
Mark all reachable objects as “live”, but object graph 
is “mutating” under us. 
Classic concurrent marking race: mutator may move 
reference that has not yet been seen by the marker 
into an object that has already been visited 
If not intercepted or prevented in some way, will corrupt the heap 
Example technique: track mutations, multi-pass marking 
Track reference mutations during mark (e.g. in card table) 
Re-visit all mutated references (and track new mutations) 
When set is “small enough”, do a STW catch up (mostly concurrent)
©2011 Azul Systems, Inc. 
Concurrent Marking 
Mark all reachable objects as “live”, but object graph 
is “mutating” under us. 
Classic concurrent marking race: mutator may move 
reference that has not yet been seen by the marker 
into an object that has already been visited 
If not intercepted or prevented in some way, will corrupt the heap 
Example technique: track mutations, multi-pass marking 
Track reference mutations during mark (e.g. in card table) 
Re-visit all mutated references (and track new mutations) 
When set is “small enough”, do a STW catch up (mostly concurrent) 
Note: work grows with mutation rate, may fail to finish
©2011 Azul Systems, Inc. 
Incremental Compaction
©2011 Azul Systems, Inc. 
Incremental Compaction 
Track cross-region remembered sets (which region 
points to which)
©2011 Azul Systems, Inc. 
Incremental Compaction 
Track cross-region remembered sets (which region 
points to which) 
To compact a single region, only need to scan regions 
that point into it to remap all potential references
©2011 Azul Systems, Inc. 
Incremental Compaction 
Track cross-region remembered sets (which region 
points to which) 
To compact a single region, only need to scan regions 
that point into it to remap all potential references 
identify regions sets that fit in limited time 
Each such set of regions is a Stop-the-World increment 
Safe to run application between (but not within) increments
©2011 Azul Systems, Inc. 
Incremental Compaction 
Track cross-region remembered sets (which region 
points to which) 
To compact a single region, only need to scan regions 
that point into it to remap all potential references 
identify regions sets that fit in limited time 
Each such set of regions is a Stop-the-World increment 
Safe to run application between (but not within) increments 
Note: work can grow with the square of the heap size 
The number of regions pointing into a single region is generally 
linear to the heap size (the number of regions in the heap)
©2011 Azul Systems, Inc. 
Delaying the inevitable
©2011 Azul Systems, Inc. 
Delaying the inevitable 
Some form of copying/compaction is inevitable in practice 
And compacting anything requires scanning/fixing all references to it
©2011 Azul Systems, Inc. 
Delaying the inevitable 
Some form of copying/compaction is inevitable in practice 
And compacting anything requires scanning/fixing all references to it 
Delay tactics focus on getting “easy empty space” first 
This is the focus for the vast majority of GC tuning
©2011 Azul Systems, Inc. 
Delaying the inevitable 
Some form of copying/compaction is inevitable in practice 
And compacting anything requires scanning/fixing all references to it 
Delay tactics focus on getting “easy empty space” first 
This is the focus for the vast majority of GC tuning 
Most objects die young [Generational] 
So collect young objects only, as much as possible. Hope for short STW. 
But eventually, some old dead objects must be reclaimed
©2011 Azul Systems, Inc. 
Delaying the inevitable 
Some form of copying/compaction is inevitable in practice 
And compacting anything requires scanning/fixing all references to it 
Delay tactics focus on getting “easy empty space” first 
This is the focus for the vast majority of GC tuning 
Most objects die young [Generational] 
So collect young objects only, as much as possible. Hope for short STW. 
But eventually, some old dead objects must be reclaimed 
Most old dead space can be reclaimed without moving it 
[e.g. CMS] track dead space in lists, and reuse it in place 
But eventually, space gets fragmented, and needs to be moved
©2011 Azul Systems, Inc. 
Delaying the inevitable 
Some form of copying/compaction is inevitable in practice 
And compacting anything requires scanning/fixing all references to it 
Delay tactics focus on getting “easy empty space” first 
This is the focus for the vast majority of GC tuning 
Most objects die young [Generational] 
So collect young objects only, as much as possible. Hope for short STW. 
But eventually, some old dead objects must be reclaimed 
Most old dead space can be reclaimed without moving it 
[e.g. CMS] track dead space in lists, and reuse it in place 
But eventually, space gets fragmented, and needs to be moved 
Much of the heap is not “popular” [e.g. G1, “Balanced”] 
A non popular region will only be pointed to from a small % of the heap 
So compact non-popular regions in short stop-the-world pauses 
But eventually, popular objects and regions need to be compacted 
Young generation pauses are only small because heaps are tiny 
A 200GB heap will regularly have several GB of live young stuff…
©2011 Azul Systems, Inc. 
Classifying common collectors
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMs
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMs 
Young generation usually uses a copying collector 
Young generation is usually monolithic, stop-the-world
©2011 Azul Systems, Inc. 
The typical combos 
in commercial server JVMs 
Young generation usually uses a copying collector 
Young generation is usually monolithic, stop-the-world 
Old generation usually uses a Mark/Sweep/Compact 
collector 
Old generation may be STW, or Concurrent, or mostly-Concurrent, 
or Incremental-STW, or mostly-Incremental-STW
©2011 Azul Systems, Inc. 
HotSpot™ ParallelGC 
Collector mechanism classification
©2011 Azul Systems, Inc. 
HotSpot™ ParallelGC 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen
©2011 Azul Systems, Inc. 
HotSpot™ ParallelGC 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen 
Monolithic Stop-the-world Mark/Sweep/Compact OldGen
HotSpot™ ConcMarkSweepGC (aka CMS) 
©2011 Azul Systems, Inc. 
Collector mechanism classification
HotSpot™ ConcMarkSweepGC (aka CMS) 
©2011 Azul Systems, Inc. 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen (ParNew)
HotSpot™ ConcMarkSweepGC (aka CMS) 
©2011 Azul Systems, Inc. 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen (ParNew) 
Mostly Concurrent, non-compacting OldGen (CMS) 
Mostly Concurrent marking 
Mark concurrently while mutator is running 
Track mutations in card marks 
Revisit mutated cards (repeat as needed) 
Stop-the-world to catch up on mutations, ref processing, etc. 
Concurrent Sweeping 
Does not Compact (maintains free list, does not move objects)
HotSpot™ ConcMarkSweepGC (aka CMS) 
©2011 Azul Systems, Inc. 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen (ParNew) 
Mostly Concurrent, non-compacting OldGen (CMS) 
Mostly Concurrent marking 
Mark concurrently while mutator is running 
Track mutations in card marks 
Revisit mutated cards (repeat as needed) 
Stop-the-world to catch up on mutations, ref processing, etc. 
Concurrent Sweeping 
Does not Compact (maintains free list, does not move objects) 
Fallback to Full Collection (Monolithic Stop the world). 
Used for Compaction, etc.
©2011 Azul Systems, Inc. 
HotSpot™ G1GC (aka “Garbage First”) 
Collector mechanism classification
©2011 Azul Systems, Inc. 
HotSpot™ G1GC (aka “Garbage First”) 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen
©2011 Azul Systems, Inc. 
HotSpot™ G1GC (aka “Garbage First”) 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen 
Mostly Concurrent, OldGen marker 
Mostly Concurrent marking 
Stop-the-world to catch up on mutations, ref processing, etc. 
Tracks inter-region relationships in remembered sets
©2011 Azul Systems, Inc. 
HotSpot™ G1GC (aka “Garbage First”) 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen 
Mostly Concurrent, OldGen marker 
Mostly Concurrent marking 
Stop-the-world to catch up on mutations, ref processing, etc. 
Tracks inter-region relationships in remembered sets 
Stop-the-world mostly incremental compacting old gen 
Objective: “Avoid, as much as possible, having a Full GC…” 
Compact sets of regions that can be scanned in limited time 
Delay compaction of popular objects, popular regions
©2011 Azul Systems, Inc. 
HotSpot™ G1GC (aka “Garbage First”) 
Collector mechanism classification 
Monolithic Stop-the-world copying NewGen 
Mostly Concurrent, OldGen marker 
Mostly Concurrent marking 
Stop-the-world to catch up on mutations, ref processing, etc. 
Tracks inter-region relationships in remembered sets 
Stop-the-world mostly incremental compacting old gen 
Objective: “Avoid, as much as possible, having a Full GC…” 
Compact sets of regions that can be scanned in limited time 
Delay compaction of popular objects, popular regions 
Fallback to Full Collection (Monolithic Stop the world). 
Used for compacting popular objects, popular regions, etc.
©2011 Azul Systems, Inc. 
The “Application Memory Wall” 
or: Why stop-the-world garbage 
collection is a problem
©2011 Azul Systems, Inc. 
Memory use 
How many of you use heap sizes of: 
F more than ½ GB? 
F more than 1 GB? 
F more than 2 GB? 
F more than 4 GB? 
F more than 10 GB? 
F more than 20 GB? 
F more than 50 GB? 
F more than 100 GB?
Reality check: servers in 2014
Reality check: servers in 2014 
Retail prices, major web server store (US $, circa 2014) 
24 vCore, 128GB server ≈ $4K 
32 vCore, 256GB server ≈ $8K 
32 vCore, 384GB server ≈ $10K 
64 vCore, 1TB server ≈ $24K
Reality check: servers in 2014 
Retail prices, major web server store (US $, circa 2014) 
24 vCore, 128GB server ≈ $4K 
32 vCore, 256GB server ≈ $8K 
32 vCore, 384GB server ≈ $10K 
64 vCore, 1TB server ≈ $24K 
Cheap (< $1/GB/Month), and roughly linear to ~1TB
Reality check: servers in 2014 
Retail prices, major web server store (US $, circa 2014) 
24 vCore, 128GB server ≈ $4K 
32 vCore, 256GB server ≈ $8K 
32 vCore, 384GB server ≈ $10K 
64 vCore, 1TB server ≈ $24K 
Cheap (< $1/GB/Month), and roughly linear to ~1TB 
10s to 100s of GB/sec of memory bandwidth
The Application Memory Wall 
©2011 Azul Systems, Inc. 
A simple observation:
The Application Memory Wall 
©2011 Azul Systems, Inc. 
A simple observation: 
Application instances appear to be unable to 
make effective use of modern server memory 
capacities
The Application Memory Wall 
©2011 Azul Systems, Inc. 
A simple observation: 
Application instances appear to be unable to 
make effective use of modern server memory 
capacities 
The size of application instances as a % of a 
server’s capacity is rapidly dropping
How much memory do applications need? 
©2011 Azul Systems, Inc.
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc.
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG!
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG! 
So what’s the right number?
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG! 
So what’s the right number? 
6,400K? 
64,000K? 
640,000K? 
6,400,000K? 
64,000,000K?
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG! 
So what’s the right number? 
6,400K? 
64,000K? 
640,000K? 
6,400,000K? 
64,000,000K? 
There is no right number
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG! 
So what’s the right number? 
6,400K? 
64,000K? 
640,000K? 
6,400,000K? 
64,000,000K? 
There is no right number 
“I've said some stupid things and 
some wrong things, but not that. 
No one involved in computers 
would ever say that a certain 
amount of memory is enough for 
all time …” - Bill Gates, 1996
How much memory do applications need? 
“640KB ought to be enough for anybody” 
©2011 Azul Systems, Inc. 
WRONG! 
So what’s the right number? 
6,400K? 
64,000K? 
640,000K? 
6,400,000K? 
64,000,000K? 
There is no right number 
Target moves at 50x-100x per decade 
“I've said some stupid things and 
some wrong things, but not that. 
No one involved in computers 
would ever say that a certain 
amount of memory is enough for 
all time …” - Bill Gates, 1996
©2011 Azul Systems, Inc. 
“Tiny” application history
©2011 Azul Systems, Inc. 
“Tiny” application history 
“Tiny”: would be “silly” to distribute
©2011 Azul Systems, Inc. 
“Tiny” application history 
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
every ≈18 months” 
It also means memory size grows 
≈100x every 10 years 
“Tiny”: would be “silly” to distribute
©2011 Azul Systems, Inc. 
“Tiny” application history 
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
every ≈18 months” 
It also means memory size grows 
≈100x every 10 years 
2010 
2000 
1990 
1980 
“Tiny”: would be “silly” to distribute
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
It also means memory size grows 
≈100x every 10 years 
©2011 Azul Systems, Inc. 
“Tiny” application history 
every ≈18 months” 
2010 
2000 
1990 
100KB apps on a ¼ to ½ MB Server 
1980 
“Tiny”: would be “silly” to distribute
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
It also means memory size grows 
≈100x every 10 years 
©2011 Azul Systems, Inc. 
“Tiny” application history 
2010 
2000 
10MB apps on a 32 – 64 MB server 
every ≈18 months” 
1990 
100KB apps on a ¼ to ½ MB Server 
1980 
“Tiny”: would be “silly” to distribute
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
It also means memory size grows 
≈100x every 10 years 
©2011 Azul Systems, Inc. 
“Tiny” application history 
2010 
1GB apps on a 2 – 4 GB server 
2000 
10MB apps on a 32 – 64 MB server 
every ≈18 months” 
1990 
100KB apps on a ¼ to ½ MB Server 
1980 
“Tiny”: would be “silly” to distribute
©2011 Azul Systems, Inc. 
“Tiny” application history 
1GB apps on a 2 – 4 GB server 
10MB apps on a 32 – 64 MB server 
100KB apps on a ¼ to ½ MB Server 
??? GB apps on 256 GB 
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
every ≈18 months” 
It also means memory size grows 
≈100x every 10 years 
2010 
2000 
1990 
1980 
“Tiny”: would be “silly” to distribute
©2011 Azul Systems, Inc. 
“Tiny” application history 
1GB apps on a 2 – 4 GB server 
10MB apps on a 32 – 64 MB server 
100KB apps on a ¼ to ½ MB Server 
??? GB apps on 256 GB 
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
every ≈18 months” 
It also means memory size grows 
≈100x every 10 years 
2010 
2000 
1990 
1980 
“Tiny”: would be “silly” to distribute
©2011 Azul Systems, Inc. 
“Tiny” application history 
Application 
Memory Wall 
1GB apps on a 2 – 4 GB server 
10MB apps on a 32 – 64 MB server 
100KB apps on a ¼ to ½ MB Server 
??? GB apps on 256 GB 
Assuming Moore’s Law means: 
“transistor counts grow at ≈2x 
every ≈18 months” 
It also means memory size grows 
≈100x every 10 years 
2010 
2000 
1990 
1980 
“Tiny”: would be “silly” to distribute
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall?
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall? 
Garbage Collection is a clear and dominant cause
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall? 
Garbage Collection is a clear and dominant cause 
There seem to be practical heap size limits for 
applications with responsiveness requirements
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall? 
Garbage Collection is a clear and dominant cause 
There seem to be practical heap size limits for 
applications with responsiveness requirements 
[Virtually] All current commercial JVMs will exhibit a 
multi-second pause on a normally utilized 2-6GB heap. 
It’s a question of “When” and “How often”, not “If”. 
GC tuning only moves the “when” and the “how often” around
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall? 
Garbage Collection is a clear and dominant cause 
There seem to be practical heap size limits for 
applications with responsiveness requirements 
[Virtually] All current commercial JVMs will exhibit a 
multi-second pause on a normally utilized 2-6GB heap. 
It’s a question of “When” and “How often”, not “If”. 
GC tuning only moves the “when” and the “how often” around 
Root cause: The link between scale and responsiveness
©2012 Azul Systems, Inc. 
What is causing the 
Application Memory Wall? 
Garbage Collection is a clear and dominant cause 
There seem to be practical heap size limits for 
applications with responsiveness requirements 
[Virtually] All current commercial JVMs will exhibit a 
multi-second pause on a normally utilized 2-6GB heap. 
It’s a question of “When” and “How often”, not “If”. 
GC tuning only moves the “when” and the “how often” around 
Root cause: The link between scale and responsiveness
What quality of GC is responsible 
for the Application Memory Wall?
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization 
It is NOT about speed 
Average speeds, 90%, 95% speeds, are all perfectly fine
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization 
It is NOT about speed 
Average speeds, 90%, 95% speeds, are all perfectly fine 
It is NOT about minor GC events (right now) 
GC events in the 10s of msec are usually tolerable for most apps
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization 
It is NOT about speed 
Average speeds, 90%, 95% speeds, are all perfectly fine 
It is NOT about minor GC events (right now) 
GC events in the 10s of msec are usually tolerable for most apps 
It is NOT about the frequency of very large pauses
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization 
It is NOT about speed 
Average speeds, 90%, 95% speeds, are all perfectly fine 
It is NOT about minor GC events (right now) 
GC events in the 10s of msec are usually tolerable for most apps 
It is NOT about the frequency of very large pauses 
It is ALL about the worst observable pause behavior 
People avoid building/deploying visibly broken systems
What quality of GC is responsible 
for the Application Memory Wall? 
It is NOT about overhead or efficiency: 
CPU utilization, bottlenecks, memory consumption and utilization 
It is NOT about speed 
Average speeds, 90%, 95% speeds, are all perfectly fine 
It is NOT about minor GC events (right now) 
GC events in the 10s of msec are usually tolerable for most apps 
It is NOT about the frequency of very large pauses 
It is ALL about the worst observable pause behavior 
People avoid building/deploying visibly broken systems
©2011 Azul Systems, Inc. 
Monolithic-STW GC Problems
One way to deal with Monolithic-STW GC
Another way to cope: Creative Language 
©2012 Azul Systems, Inc.
Another way to cope: Creative Language 
“Guarantee a worst case of X msec, 99% of the time” 
©2012 Azul Systems, Inc.
Another way to cope: Creative Language 
“Guarantee a worst case of X msec, 99% of the time” 
“Mostly” Concurrent, “Mostly” Incremental 
Translation: “Will at times exhibit long monolithic stop-the- 
©2012 Azul Systems, Inc. 
world pauses”
Another way to cope: Creative Language 
“Guarantee a worst case of X msec, 99% of the time” 
“Mostly” Concurrent, “Mostly” Incremental 
Translation: “Will at times exhibit long monolithic stop-the- 
world pauses” 
“Fairly Consistent” 
Translation: “Will sometimes show results well outside 
this range” 
©2012 Azul Systems, Inc.
Another way to cope: Creative Language 
“Guarantee a worst case of X msec, 99% of the time” 
“Mostly” Concurrent, “Mostly” Incremental 
Translation: “Will at times exhibit long monolithic stop-the- 
world pauses” 
“Fairly Consistent” 
Translation: “Will sometimes show results well outside 
this range” 
“Typical pauses in the tens of milliseconds” 
Translation: “Some pauses are much longer than tens of 
milliseconds” 
©2012 Azul Systems, Inc.
©2012 Azul Systems, Inc. 
Actually measuring things
©2012 Azul Systems, Inc. 
Incontinuities in Java platform execution 
1800" 
1600" 
1400" 
1200" 
1000" 
800" 
600" 
400" 
200" 
0" 
Hiccups"by"Time"Interval" 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 200" 400" 600" 800" 1000" 1200" 1400" 1600" 1800" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Max=1665.024& 
Hiccups"by"Percen@le"Distribu@on" 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
1800" 
1600" 
1400" 
1200" 
1000" 
800" 
600" 
400" 
200" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le&
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
©2013 Azul Systems, Inc. 
Oracle HotSpot CMS, 1GB in an 8GB heap 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=13156.352& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le& 
Zing 5, 1GB in an 8GB heap 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=20.384& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le&
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
©2013 Azul Systems, Inc. 
Oracle HotSpot CMS, 1GB in an 8GB heap 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=13156.352& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le& 
Zing 5, 1GB in an 8GB heap 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=20.384& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le&
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
©2013 Azul Systems, Inc. 
Oracle HotSpot CMS, 1GB in an 8GB heap 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=13156.352& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le& 
Zing 5, 1GB in an 8GB heap 
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 500" 1000" 1500" 2000" 2500" 3000" 3500" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
0%" Max9=02%0".384& 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 
14000" 
12000" 
10000" 
8000" 
6000" 
4000" 
2000" 
0" 
Hiccup&Dura*on&(msec)& 
&& 
Percen*le& 
Drawn to scale
Oracle HotSpot (pure newgen) 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
25" 
20" 
15" 
10" 
5" 
©2013 Azul Systems, Inc. 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=22.656& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le& 
Low latency trading application
Oracle HotSpot (pure newgen) Zing 
25" 
20" 
15" 
10" 
5" 
25" 
20" 
15" 
10" 
5" 
©2013 Azul Systems, Inc. 
1.8" 
1.6" 
1.4" 
1.2" 
1" 
0.8" 
0.6" 
0.4" 
0.2" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=1.568& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
1.8" 
1.6" 
1.4" 
1.2" 
1" 
0.8" 
0.6" 
0.4" 
0.2" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le& 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=22.656& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le& 
Low latency trading application
Oracle HotSpot (pure newgen) Zing 
25" 
20" 
15" 
10" 
5" 
25" 
20" 
15" 
10" 
5" 
©2013 Azul Systems, Inc. 
1.8" 
1.6" 
1.4" 
1.2" 
1" 
0.8" 
0.6" 
0.4" 
0.2" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=1.568& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
1.8" 
1.6" 
1.4" 
1.2" 
1" 
0.8" 
0.6" 
0.4" 
0.2" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le& 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=22.656& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le& 
Low latency trading application
Oracle HotSpot (pure newgen) Zing 
25" 
20" 
15" 
10" 
5" 
25" 
20" 
15" 
10" 
5" 
©2013 Azul Systems, Inc. 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Hiccups&by&Percen*le&Distribu*on& 
Max=1.568& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
25" 
20" 
15" 
10" 
5" 
0" 
Hiccup&Dura*on&(msec)& 
Hiccups&by&Time&Interval& 
Max"per"Interval" 99%" 99.90%" 99.99%" Max" 
Hiccups&by&Percen*le&Distribu*on& 
Low latency - Drawn to scale 
& 
& 
Percen*le& 
0" 
0" 100" 200" 300" 400" 500" 600" 
Hiccup&Dura*on&(msec)& 
&Elapsed&Time&(sec)& 
Max=22.656& 
0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 
0" 
Hiccup&Dura*on&(msec)& 
& 
& 
Percen*le&
Comparing latency behavior under different throughputs, configurations 
90# 
80# 
70# 
60# 
50# 
40# 
30# 
20# 
10# 
©2013 Azul Systems, Inc. 
latency sensitive messaging distribution application 
0%# 90%# 99%# 99.9%# 99.99%# 99.999%# 
0# 
Latency((milliseconds)( 
( 
( 
HotSpot&15K& 
Required& 
Service&Level& 
Percen3le( 
Latency(by(Percen3le(Distribu3on( 
HotSpot&10K&&& 
HotSpot&5K& 
HotSpot&1K& 
Zing&15K& 
Zing&10K& 
Zing&5K& 
Zing&1K& 
&
©2011 Azul Systems, Inc. 
Sustainable Throughput: 
The throughput achieved while 
safely maintaining service levels
©2011 Azul Systems, Inc. 
Sustainable Throughput: 
The throughput achieved while 
safely maintaining service levels
©2011 Azul Systems, Inc. 
Sustainable Throughput: 
The throughput achieved while 
safely maintaining service levels 
Unsustainable 
Throughout
©2011 Azul Systems, Inc. 
Getting past a monolithic-STW 
Garbage Collection world
©2011 Azul Systems, Inc. 
We need to solve the right problems
©2011 Azul Systems, Inc. 
We need to solve the right problems 
Scale is artificially limited by responsiveness
©2011 Azul Systems, Inc. 
We need to solve the right problems 
Scale is artificially limited by responsiveness 
Responsiveness must be unlinked from scale: 
Heap size, Live Set size, Allocation rate, Mutation rate 
Transaction Rate, Concurrent users, Data set size, etc. 
Responsiveness must be continually sustainable 
Can’t ignore “rare” events
©2011 Azul Systems, Inc. 
We need to solve the right problems 
Scale is artificially limited by responsiveness 
Responsiveness must be unlinked from scale: 
Heap size, Live Set size, Allocation rate, Mutation rate 
Transaction Rate, Concurrent users, Data set size, etc. 
Responsiveness must be continually sustainable 
Can’t ignore “rare” events 
Eliminate all Stop-The-World Fallbacks 
At modern server scales, any STW fall back is a failure
©2011 Azul Systems, Inc. 
We need to solve the right problems 
Scale is artificially limited by responsiveness 
Responsiveness must be unlinked from scale: 
Heap size, Live Set size, Allocation rate, Mutation rate 
Transaction Rate, Concurrent users, Data set size, etc. 
Responsiveness must be continually sustainable 
Can’t ignore “rare” events 
Eliminate all Stop-The-World Fallbacks 
At modern server scales, any STW fall back is a failure
©2011 Azul Systems, Inc. 
The problems that need solving 
(areas where the state of the art needs improvement)
The problems that need solving 
(areas where the state of the art needs improvement) 
Robust Concurrent Marking 
In the presence of high mutation and allocation rates 
Cover modern runtime semantics (e.g. weak refs, lock deflation) 
©2011 Azul Systems, Inc.
The problems that need solving 
(areas where the state of the art needs improvement) 
Robust Concurrent Marking 
In the presence of high mutation and allocation rates 
Cover modern runtime semantics (e.g. weak refs, lock deflation) 
Compaction that is not monolithic-stop-the-world 
E.g. stay responsive while compacting ¼ TB heaps 
Must be robust: not just a tactic to delay STW compaction 
[current “incremental STW” attempts fall short on robustness] 
©2011 Azul Systems, Inc.
The problems that need solving 
(areas where the state of the art needs improvement) 
Robust Concurrent Marking 
In the presence of high mutation and allocation rates 
Cover modern runtime semantics (e.g. weak refs, lock deflation) 
Compaction that is not monolithic-stop-the-world 
E.g. stay responsive while compacting ¼ TB heaps 
Must be robust: not just a tactic to delay STW compaction 
[current “incremental STW” attempts fall short on robustness] 
Young-Gen that is not monolithic-stop-the-world 
Stay responsive while promoting multi-GB data spikes 
Concurrent or “incremental STW” may both be ok 
Surprisingly little work done in this specific area 
©2011 Azul Systems, Inc.
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing 
Concurrent Compactor 
Objects moved without stopping mutator 
References remapped without stopping mutator 
Can relocate entire generation (New, Old) in every GC cycle
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing 
Concurrent Compactor 
Objects moved without stopping mutator 
References remapped without stopping mutator 
Can relocate entire generation (New, Old) in every GC cycle 
Concurrent, compacting old generation
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing 
Concurrent Compactor 
Objects moved without stopping mutator 
References remapped without stopping mutator 
Can relocate entire generation (New, Old) in every GC cycle 
Concurrent, compacting old generation 
Concurrent, compacting new generation
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing 
Concurrent Compactor 
Objects moved without stopping mutator 
References remapped without stopping mutator 
Can relocate entire generation (New, Old) in every GC cycle 
Concurrent, compacting old generation 
Concurrent, compacting new generation 
No stop-the-world fallback 
Always compacts, and always does so concurrently
©2011 Azul Systems, Inc. 
Azul’s “C4” Collector 
Continuously Concurrent Compacting Collector 
Concurrent guaranteed-single-pass marker 
Oblivious to mutation rate 
Concurrent ref (weak, soft, final) processing 
Concurrent Compactor 
Objects moved without stopping mutator 
References remapped without stopping mutator 
Can relocate entire generation (New, Old) in every GC cycle 
Concurrent, compacting old generation 
Concurrent, compacting new generation 
No stop-the-world fallback 
Always compacts, and always does so concurrently
©2011 Azul Systems, Inc. 
C4 algorithm highlights
©2011 Azul Systems, Inc. 
C4 algorithm highlights 
Same core mechanism used for both generations 
Concurrent Mark-Compact
©2011 Azul Systems, Inc. 
C4 algorithm highlights 
Same core mechanism used for both generations 
Concurrent Mark-Compact 
A Loaded Value Barrier (LVB) is central to the algorithm 
Every heap reference is verified as “sane” when loaded 
“Non-sane” refs are caught and fixed in a self-healing barrier
©2011 Azul Systems, Inc. 
C4 algorithm highlights 
Same core mechanism used for both generations 
Concurrent Mark-Compact 
A Loaded Value Barrier (LVB) is central to the algorithm 
Every heap reference is verified as “sane” when loaded 
“Non-sane” refs are caught and fixed in a self-healing barrier 
Refs that have not yet been “marked through” are caught 
Guaranteed single pass concurrent marker
©2011 Azul Systems, Inc. 
C4 algorithm highlights 
Same core mechanism used for both generations 
Concurrent Mark-Compact 
A Loaded Value Barrier (LVB) is central to the algorithm 
Every heap reference is verified as “sane” when loaded 
“Non-sane” refs are caught and fixed in a self-healing barrier 
Refs that have not yet been “marked through” are caught 
Guaranteed single pass concurrent marker 
Refs that point to relocated objects are caught 
Lazily (and concurrently) remap refs, no hurry 
Relocation and remapping are both concurrent
©2011 Azul Systems, Inc. 
C4 algorithm highlights 
Same core mechanism used for both generations 
Concurrent Mark-Compact 
A Loaded Value Barrier (LVB) is central to the algorithm 
Every heap reference is verified as “sane” when loaded 
“Non-sane” refs are caught and fixed in a self-healing barrier 
Refs that have not yet been “marked through” are caught 
Guaranteed single pass concurrent marker 
Refs that point to relocated objects are caught 
Lazily (and concurrently) remap refs, no hurry 
Relocation and remapping are both concurrent 
Uses “quick release” to recycle memory 
Forwarding information is kept outside of object pages 
Physical memory released immediately upon relocation 
“Hand-over-hand” compaction without requiring empty memory
©2011 Azul Systems, Inc. 
Benefits 
ELIMINATES Garbage Collection as a 
concern for enterprise applications
©2011 Azul Systems, Inc. 
GC Tuning
Some 
GC 
tuning 
flags 
(although 
some 
are 
absolute 
now) 
Source: 
Word 
Cloud 
created 
by 
Frank 
Pavageau 
in 
his 
Devoxx 
FR 
2012 
presentaGon 
Gtled 
“Death 
by 
Pauses”
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”…
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”… 
Examples of actual command line GC tuning parameters:
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”… 
Examples of actual command line GC tuning parameters: 
Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g 
-XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC 
-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 
-XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled 
-XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 
-XX:LargePageSizeInBytes=256m …
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”… 
Examples of actual command line GC tuning parameters: 
Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g 
-XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC 
-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 
-XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled 
-XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 
-XX:LargePageSizeInBytes=256m … 
Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M 
-XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy 
-XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled 
-XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled 
-XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly 
-XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”… 
Examples of actual command line GC tuning parameters: 
Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g 
-XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC 
-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 
-XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled 
-XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 
-XX:LargePageSizeInBytes=256m … 
Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M 
-XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy 
-XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled 
-XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled 
-XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly 
-XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
©2011 Azul Systems, Inc. 
Java GC tuning is “hard”… 
Examples of actual command line GC tuning parameters: 
Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g 
-XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC 
-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 
-XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled 
-XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 
-XX:LargePageSizeInBytes=256m … 
Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M 
-XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy 
-XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled 
-XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled 
-XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly 
-XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
©Systems, Inc. 
©2013 Azul Systems, Inc. 
The complete guide to 
modern GC tuning**
©Systems, Inc. 
©2013 Azul Systems, Inc. 
The complete guide to 
modern GC tuning** 
java -Xmx40g
©Systems, Inc. 
©2013 Azul Systems, Inc. 
The complete guide to 
modern GC tuning** 
java -Xmx40g 
java -Xmx20g
©Systems, Inc. 
©2013 Azul Systems, Inc. 
The complete guide to 
modern GC tuning** 
java -Xmx40g 
java -Xmx20g 
java -Xmx10g
©Systems, Inc. 
©2013 Azul Systems, Inc. 
The complete guide to 
modern GC tuning** 
java -Xmx40g 
java -Xmx20g 
java -Xmx10g 
java -Xmx5g
©2013 Azul Systems, Inc. 
An overview Azul & Zing
©2013 Azul Systems, Inc. 
An overview Azul & Zing
©2013 Azul Systems, Inc. 
About Azul
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega)
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega) 
Vega
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega) 
Vega
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega) 
Zing: Pure software for 
commodity x86 
Vega
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega) 
Zing: Pure software for 
commodity x86 
Vega 
C4
©2013 Azul Systems, Inc. 
About Azul 
We make scalable Virtual 
Machines 
Have built “whatever it takes to 
get job done” since 2002 
3 generations of custom SMP 
Multi-core HW (Vega) 
Zing: Pure software for 
commodity x86 
Known for Low Latency, 
Consistent execution, and Large 
data set excellence 
Vega 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
Zing: A metrically better JVM 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
Zing: A metrically better JVM 
Zulu: A commercialized, fully 
supported version of OpenJDK 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
Zing: A metrically better JVM 
Zulu: A commercialized, fully 
supported version of OpenJDK 
Long term, commercial support 
for Java SE 6, Java SE 7, (and 
8 as it comes out) 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
Zing: A metrically better JVM 
Zulu: A commercialized, fully 
supported version of OpenJDK 
Long term, commercial support 
for Java SE 6, Java SE 7, (and 
8 as it comes out) 
Zulu: Free & Open Source, 
changes contributed back to 
OpenJDK 
C4
©©2013 Azul Systems, Systems, Inc. 
Inc. 
About Azul 
We also do other things with 
JVMs 
Zing: A metrically better JVM 
Zulu: A commercialized, fully 
supported version of OpenJDK 
Long term, commercial support 
for Java SE 6, Java SE 7, (and 
8 as it comes out) 
Zulu: Free & Open Source, 
changes contributed back to 
OpenJDK 
Windows & Linux, Azure & EC2 
C4
©2013 Azul Systems, Inc. 
Zing
©2013 Azul Systems, Inc. 
Zing 
A JVM for Linux/x86 servers
©2013 Azul Systems, Inc. 
Zing 
A JVM for Linux/x86 servers 
ELIMINATES Garbage Collection as a concern for 
enterprise applications
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014
GC @ jmaghreb2014

Mais conteúdo relacionado

Destaque

JVM bytecode - The secret language behind Java and Scala
JVM bytecode - The secret language behind Java and ScalaJVM bytecode - The secret language behind Java and Scala
JVM bytecode - The secret language behind Java and ScalaTakipi
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerJAXLondon_Conference
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage CollectionAzul Systems Inc.
 
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 PresentationLudovic Poitou
 
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 ItAzul Systems Inc.
 
[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?Alonso Torres
 

Destaque (6)

JVM bytecode - The secret language behind Java and Scala
JVM bytecode - The secret language behind Java and ScalaJVM bytecode - The secret language behind Java and Scala
JVM bytecode - The secret language behind Java and Scala
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika Langer
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
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
 
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
 
[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?
 

Semelhante a GC @ jmaghreb2014

Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Azul Systems Inc.
 
Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Azul Systems Inc.
 
Enterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchEnterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchAzul Systems Inc.
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsAzul Systems Inc.
 
Boyd Hemphill (Tsunami) Geekfest
Boyd Hemphill (Tsunami) GeekfestBoyd Hemphill (Tsunami) Geekfest
Boyd Hemphill (Tsunami) GeekfestW2O Group
 
The Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMThe Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMAzul Systems Inc.
 
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemsEnabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemszuluJDK
 
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil TeneUnderstanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil Tenejaxconf
 
The Java Evolution Mismatch by Gil Tene, CTO at Azul Systems
The Java Evolution Mismatch by Gil Tene, CTO at Azul SystemsThe Java Evolution Mismatch by Gil Tene, CTO at Azul Systems
The Java Evolution Mismatch by Gil Tene, CTO at Azul SystemszuluJDK
 
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013Azul Systems Inc.
 
Understanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemUnderstanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemAzul Systems Inc.
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010yaevents
 
Enabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive EnvironmentsEnabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive EnvironmentsC4Media
 
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdf
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdfDo Reinvent the Wheel - Nov 2021 - DigiNext.pdf
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdfHamidreza Soleimani
 
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsDotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsAzul Systems Inc.
 
Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)W2O Group
 
Say Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentSay Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentAdam Magaña
 
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du CloudObjectif Libre
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Bram Adams
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in ActionBill Scott
 

Semelhante a GC @ jmaghreb2014 (20)

Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017
 
Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017
 
Enterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchEnterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up Search
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive Applications
 
Boyd Hemphill (Tsunami) Geekfest
Boyd Hemphill (Tsunami) GeekfestBoyd Hemphill (Tsunami) Geekfest
Boyd Hemphill (Tsunami) Geekfest
 
The Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMThe Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVM
 
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul SystemsEnabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
Enabling Java in Latency Sensitive Applications by Gil Tene, CTO, Azul Systems
 
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil TeneUnderstanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
 
The Java Evolution Mismatch by Gil Tene, CTO at Azul Systems
The Java Evolution Mismatch by Gil Tene, CTO at Azul SystemsThe Java Evolution Mismatch by Gil Tene, CTO at Azul Systems
The Java Evolution Mismatch by Gil Tene, CTO at Azul Systems
 
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013How NOT to Measure Latency, Gil Tene, London, Oct. 2013
How NOT to Measure Latency, Gil Tene, London, Oct. 2013
 
Understanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemUnderstanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About Them
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010
 
Enabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive EnvironmentsEnabling Java in Latency Sensitive Environments
Enabling Java in Latency Sensitive Environments
 
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdf
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdfDo Reinvent the Wheel - Nov 2021 - DigiNext.pdf
Do Reinvent the Wheel - Nov 2021 - DigiNext.pdf
 
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsDotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
 
Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)
 
Say Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentSay Goodbye To Java: Getting Started With Kotlin For Android Development
Say Goodbye To Java: Getting Started With Kotlin For Android Development
 
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud
20151119 Sensibilisation des Utilisateurs aux coûts d'usage du Cloud
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 

Mais de Ivan Krylov

Java 9: what is there beyond modularization
Java 9: what is there beyond modularizationJava 9: what is there beyond modularization
Java 9: what is there beyond modularizationIvan Krylov
 
Code lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzCode lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzIvan Krylov
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Разговор про Java 9. Extended version
Разговор про Java 9. Extended versionРазговор про Java 9. Extended version
Разговор про Java 9. Extended versionIvan Krylov
 
OpenJDK-Zulu talk at JEEConf'14
OpenJDK-Zulu talk at JEEConf'14OpenJDK-Zulu talk at JEEConf'14
OpenJDK-Zulu talk at JEEConf'14Ivan Krylov
 

Mais de Ivan Krylov (6)

Java 9: what is there beyond modularization
Java 9: what is there beyond modularizationJava 9: what is there beyond modularization
Java 9: what is there beyond modularization
 
Code lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf LinzCode lifecycle in the jvm - TopConf Linz
Code lifecycle in the jvm - TopConf Linz
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Разговор про Java 9. Extended version
Разговор про Java 9. Extended versionРазговор про Java 9. Extended version
Разговор про Java 9. Extended version
 
Java 9 preview
Java 9 previewJava 9 preview
Java 9 preview
 
OpenJDK-Zulu talk at JEEConf'14
OpenJDK-Zulu talk at JEEConf'14OpenJDK-Zulu talk at JEEConf'14
OpenJDK-Zulu talk at JEEConf'14
 

Último

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Último (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

GC @ jmaghreb2014

  • 1. ©2011 Azul Systems, Inc. Understanding Java Garbage Collection and what you can do about it Ivan Krylov, Azul Systems Slides Courtesy Gil Tene, CTO & co-Founder, Azul Systems
  • 2. ©2013 Azul Systems, Inc. About me: Ivan Krylov
  • 3. ©2013 Azul Systems, Inc. About me: Ivan Krylov Sr. engineer @Azul Systems
  • 4. ©2013 Azul Systems, Inc. About me: Ivan Krylov Sr. engineer @Azul Systems Work mainly on JVM Runtime
  • 5. ©2013 Azul Systems, Inc. About me: Ivan Krylov Sr. engineer @Azul Systems Work mainly on JVM Runtime Previously worked on a JIT compiler for HSAIL stack
  • 6. ©2013 Azul Systems, Inc. About me: Ivan Krylov Sr. engineer @Azul Systems Work mainly on JVM Runtime Previously worked on a JIT compiler for HSAIL stack Previously worked at Sun Microsystems / Oracle at the Hotspot Devteam - jvm runtime
  • 7. ©2013 Azul Systems, Inc. About me: Ivan Krylov Sr. engineer @Azul Systems Work mainly on JVM Runtime Previously worked on a JIT compiler for HSAIL stack Previously worked at Sun Microsystems / Oracle at the Hotspot Devteam - jvm runtime Ph.D. (2004) in Appl. Math.
  • 8. ©2011 Azul Systems, Inc. This Talk’s Purpose / Goals
  • 9. ©2011 Azul Systems, Inc. This Talk’s Purpose / Goals This talk is focused on GC education
  • 10. ©2011 Azul Systems, Inc. This Talk’s Purpose / Goals This talk is focused on GC education This is not a “how to use flags to tune a collector” talk
  • 11. ©2011 Azul Systems, Inc. This Talk’s Purpose / Goals This talk is focused on GC education This is not a “how to use flags to tune a collector” talk This is a talk about how the “GC machine” works
  • 12. ©2011 Azul Systems, Inc. This Talk’s Purpose / Goals This talk is focused on GC education This is not a “how to use flags to tune a collector” talk This is a talk about how the “GC machine” works The “Azul makes the world’s greatest GC” stuff will/ may come at the end …
  • 13. ©2011 Azul Systems, Inc. High level agenda
  • 14. ©2011 Azul Systems, Inc. High level agenda GC fundamentals and key mechanisms
  • 15. ©2011 Azul Systems, Inc. High level agenda GC fundamentals and key mechanisms Some GC terminology & metrics
  • 16. ©2011 Azul Systems, Inc. High level agenda GC fundamentals and key mechanisms Some GC terminology & metrics Classifying current commercially available collectors
  • 17. ©2011 Azul Systems, Inc. High level agenda GC fundamentals and key mechanisms Some GC terminology & metrics Classifying current commercially available collectors Why Stop-The-World is a problem
  • 18. ©2011 Azul Systems, Inc. High level agenda GC fundamentals and key mechanisms Some GC terminology & metrics Classifying current commercially available collectors Why Stop-The-World is a problem The C4 collector: What a solution to STW looks like...
  • 19. ©2011 Azul Systems, Inc. Why should you understand (at least a little) how GC works?
  • 20. ©2011 Azul Systems, Inc. The story of the good little architect
  • 21. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... ©2011 Azul Systems, Inc.
  • 22. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses ©2011 Azul Systems, Inc.
  • 23. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle ©2011 Azul Systems, Inc.
  • 24. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle ©2011 Azul Systems, Inc. *We have since made reference processing fully concurrent...
  • 25. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle *We have since made reference processing fully concurrent... Every single class written in the project had a finalizer ©2011 Azul Systems, Inc.
  • 26. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle *We have since made reference processing fully concurrent... Every single class written in the project had a finalizer The only work the finalizers did was nulling every reference field ©2011 Azul Systems, Inc.
  • 27. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle *We have since made reference processing fully concurrent... Every single class written in the project had a finalizer The only work the finalizers did was nulling every reference field The right discipline for a C++ ref-counting environment ©2011 Azul Systems, Inc.
  • 28. The story of the good little architect A good architect must, first and foremost, be able to impose their architectural choices on the project... Early in Azul’s concurrent collector days, we encountered an application exhibiting 18 second pauses Upon investigation, we found the collector was performing 10s of millions of object finalizations per GC cycle *We have since made reference processing fully concurrent... Every single class written in the project had a finalizer The only work the finalizers did was nulling every reference field The right discipline for a C++ ref-counting environment The wrong discipline for a precise garbage collected environment ©2011 Azul Systems, Inc.
  • 29. ©2011 Azul Systems, Inc. Much of what People seem to “know” about Garbage Collection is wrong
  • 30. Much of what People seem to “know” about Garbage Collection is wrong In many cases, it’s much better than you may think GC is extremely efficient. Much more so that malloc() Dead objects cost nothing to collect GC will find all the dead objects (including cyclic graphs) ... ©2011 Azul Systems, Inc.
  • 31. Much of what People seem to “know” about Garbage Collection is wrong In many cases, it’s much better than you may think GC is extremely efficient. Much more so that malloc() Dead objects cost nothing to collect GC will find all the dead objects (including cyclic graphs) ... In many cases, it’s much worse than you may think Yes, it really will stop for ~1 sec per live GB (except with Zing) No, GC does not mean you can’t have memory leaks No, those pauses you eliminated from your 20 minute test are not gone ... ©2011 Azul Systems, Inc.
  • 32. ©2011 Azul Systems, Inc. Memory use How many of you use heap sizes of: F more than ½ GB? F more than 1 GB? F more than 2 GB? F more than 4 GB? F more than 10 GB? F more than 20 GB? F more than 50 GB? F more than 100 GB?
  • 33. ©2011 Azul Systems, Inc. Memory use How many of you use heap sizes of: F more than ½ GB? F more than 1 GB? F more than 2 GB? F more than 4 GB? F more than 10 GB? F more than 20 GB? F more than 50 GB? F more than 100 GB?
  • 34. ©2011 Azul Systems, Inc. Some GC Terminology
  • 35. ©2011 Azul Systems, Inc. A Basic Terminology example: What is a concurrent collector?
  • 36. ©2011 Azul Systems, Inc. A Basic Terminology example: What is a concurrent collector? A Concurrent Collector performs garbage collection work concurrently with the application’s own execution
  • 37. ©2011 Azul Systems, Inc. A Basic Terminology example: What is a concurrent collector? A Concurrent Collector performs garbage collection work concurrently with the application’s own execution A Parallel Collector uses multiple CPUs to perform garbage collection
  • 38. A Concurrent Collector performs garbage collection work concurrently with the application’s own execution A Parallel Collector uses multiple CPUs to perform garbage collection ©2011 Azul Systems, Inc. Classifying a collector’s operation
  • 39. A Concurrent Collector performs garbage collection work concurrently with the application’s own execution A Parallel Collector uses multiple CPUs to perform garbage collection ©2011 Azul Systems, Inc. Classifying a collector’s operation A Stop-the-World collector performs garbage collection while the application is completely stopped
  • 40. A Concurrent Collector performs garbage collection work concurrently with the application’s own execution A Parallel Collector uses multiple CPUs to perform garbage collection A Stop-the-World collector performs garbage collection while the application is completely stopped ©2011 Azul Systems, Inc. Classifying a collector’s operation An Incremental collector performs a garbage collection operation or phase as a series of smaller discrete operations with (potentially long) gaps in between
  • 41. A Concurrent Collector performs garbage collection work concurrently with the application’s own execution A Parallel Collector uses multiple CPUs to perform garbage collection A Stop-the-World collector performs garbage collection while the application is completely stopped ©2011 Azul Systems, Inc. Classifying a collector’s operation An Incremental collector performs a garbage collection operation or phase as a series of smaller discrete operations with (potentially long) gaps in between Mostly means sometimes it isn’t (usually means a different fall back mechanism exists)
  • 42. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection
  • 43. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not
  • 44. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not A Collector is Precise if it can fully identify and process all object references at the time of collection A collector MUST be precise in order to move objects The COMPILERS need to produce a lot of information (oopmaps)
  • 45. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not A Collector is Precise if it can fully identify and process all object references at the time of collection A collector MUST be precise in order to move objects The COMPILERS need to produce a lot of information (oopmaps) All commercial server JVMs use precise collectors All commercial server JVMs use some form of a moving collector
  • 46. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not A Collector is Precise if it can fully identify and process all object references at the time of collection A collector MUST be precise in order to move objects The COMPILERS need to produce a lot of information (oopmaps) All commercial server JVMs use precise collectors All commercial server JVMs use some form of a moving collector
  • 47. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not A Collector is Precise if it can fully identify and process all object references at the time of collection A collector MUST be precise in order to move objects The COMPILERS need to produce a lot of information (oopmaps) All commercial server JVMs use precise collectors All commercial server JVMs use some form of a moving collector
  • 48. ©2011 Azul Systems, Inc. Precise vs. Conservative Collection A Collector is Conservative if it is unaware of some object references at collection time, or is unsure about whether a field is a reference or not A Collector is Precise if it can fully identify and process all object references at the time of collection A collector MUST be precise in order to move objects The COMPILERS need to produce a lot of information (oopmaps) All commercial server JVMs use precise collectors All commercial server JVMs use some form of a moving collector
  • 49. ©2011 Azul Systems, Inc. Safepoints
  • 50. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack
  • 51. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably
  • 52. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization)
  • 53. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization) “Bringing a thread to a safepoint” is the act of getting a thread to reach a safepoint and not execute past it
  • 54. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization) “Bringing a thread to a safepoint” is the act of getting a thread to reach a safepoint and not execute past it Close to, but not exactly the same as “stop at a safepoint”
  • 55. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization) “Bringing a thread to a safepoint” is the act of getting a thread to reach a safepoint and not execute past it Close to, but not exactly the same as “stop at a safepoint” e.g. JNI: you can keep running in, but not past the safepoint
  • 56. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization) “Bringing a thread to a safepoint” is the act of getting a thread to reach a safepoint and not execute past it Close to, but not exactly the same as “stop at a safepoint” e.g. JNI: you can keep running in, but not past the safepoint Safepoint opportunities are (or should be) frequent
  • 57. ©2011 Azul Systems, Inc. Safepoints A GC Safepoint is a point or range in a thread’s execution where the collector can identify all the references in that thread’s execution stack “Safepoint” and “GC Safepoint” are often used interchangeably But there are other types of safepoints, including ones that require more information than a GC safepoint does (e.g. deoptimization) “Bringing a thread to a safepoint” is the act of getting a thread to reach a safepoint and not execute past it Close to, but not exactly the same as “stop at a safepoint” e.g. JNI: you can keep running in, but not past the safepoint Safepoint opportunities are (or should be) frequent In a Global Safepoint all threads are at a Safepoint
  • 58. ©2011 Azul Systems, Inc. Useful terms for discussing Mutator Your program… Parallel garbage collection Can use multiple CPUs Concurrent Runs concurrently with program Pause A time duration in which the mutator is not running any code Stop-The-World (STW) Something that is done in a pause Monolithic Stop-The-World Something that must be done in it’s entirety in a single pause Generational Collects young objects and long lived objects separately. Promotion Allocation into old generation Marking Finding all live objects Sweeping Locating the dead objects Compaction Defragments heap Moves objects in memory Remaps all affected references Frees contiguous memory regions
  • 59. ©2011 Azul Systems, Inc. Useful terms for discussing Mutator Your program… Parallel garbage collection Can use multiple CPUs Concurrent Runs concurrently with program Pause A time duration in which the mutator is not running any code Stop-The-World (STW) Something that is done in a pause Monolithic Stop-The-World Something that must be done in it’s entirety in a single pause Generational Collects young objects and long lived objects separately. Promotion Allocation into old generation Marking Finding all live objects Sweeping Locating the dead objects Compaction Defragments heap Moves objects in memory Remaps all affected references Frees contiguous memory regions
  • 60. ©2011 Azul Systems, Inc. Useful metrics for discussing garbage Heap population (aka Live set) How much of your heap is alive Allocation rate How fast you allocate Mutation rate How fast your program updates references in memory Heap Shape The shape of the live object graph * Hard to quantify as a metric... Object Lifetime How long objects live collection Cycle time How long it takes the collector to free up memory Marking time How long it takes the collector to find all live objects Sweep time How long it takes to locate dead objects * Relevant for Mark-Sweep Compaction time How long it takes to free up memory by relocating objects * Relevant for Mark-Compact
  • 61. ©2011 Azul Systems, Inc. Useful metrics for discussing garbage Heap population (aka Live set) How much of your heap is alive Allocation rate How fast you allocate Mutation rate How fast your program updates references in memory Heap Shape The shape of the live object graph * Hard to quantify as a metric... Object Lifetime How long objects live collection Cycle time How long it takes the collector to free up memory Marking time How long it takes the collector to find all live objects Sweep time How long it takes to locate dead objects * Relevant for Mark-Sweep Compaction time How long it takes to free up memory by relocating objects * Relevant for Mark-Compact
  • 62. ©2011 Azul Systems, Inc. Useful metrics for discussing garbage Heap population (aka Live set) How much of your heap is alive Allocation rate How fast you allocate Mutation rate How fast your program updates references in memory Heap Shape The shape of the live object graph * Hard to quantify as a metric... Object Lifetime How long objects live collection Cycle time How long it takes the collector to free up memory Marking time How long it takes the collector to find all live objects Sweep time How long it takes to locate dead objects * Relevant for Mark-Sweep Compaction time How long it takes to free up memory by relocating objects * Relevant for Mark-Compact
  • 63. ©2011 Azul Systems, Inc. Useful metrics for discussing garbage Heap population (aka Live set) How much of your heap is alive Allocation rate How fast you allocate Mutation rate How fast your program updates references in memory Heap Shape The shape of the live object graph * Hard to quantify as a metric... Object Lifetime How long objects live collection Cycle time How long it takes the collector to free up memory Marking time How long it takes the collector to find all live objects Sweep time How long it takes to locate dead objects * Relevant for Mark-Sweep Compaction time How long it takes to free up memory by relocating objects * Relevant for Mark-Compact
  • 64. ©2011 Azul Systems, Inc. Useful metrics for discussing garbage Heap population (aka Live set) How much of your heap is alive Allocation rate How fast you allocate Mutation rate How fast your program updates references in memory Heap Shape The shape of the live object graph * Hard to quantify as a metric... Object Lifetime How long objects live collection Cycle time How long it takes the collector to free up memory Marking time How long it takes the collector to find all live objects Sweep time How long it takes to locate dead objects * Relevant for Mark-Sweep Compaction time How long it takes to free up memory by relocating objects * Relevant for Mark-Compact
  • 65. ©2011 Azul Systems, Inc. What’s common to all precise GC mechanisms?
  • 66. ©2011 Azul Systems, Inc. What’s common to all precise GC mechanisms? Identify the live objects in the memory heap
  • 67. ©2011 Azul Systems, Inc. What’s common to all precise GC mechanisms? Identify the live objects in the memory heap Reclaim resources held by dead objects
  • 68. ©2011 Azul Systems, Inc. What’s common to all precise GC mechanisms? Identify the live objects in the memory heap Reclaim resources held by dead objects Periodically relocate live objects
  • 69. ©2011 Azul Systems, Inc. What’s common to all precise GC mechanisms? Identify the live objects in the memory heap Reclaim resources held by dead objects Periodically relocate live objects Examples: Mark/Sweep/Compact (common for Old Generations) Copying collector (common for Young Generations)
  • 70. ©2011 Azul Systems, Inc. Mark (aka “Trace”)
  • 71. ©2011 Azul Systems, Inc. Mark (aka “Trace”) Start from “roots” (thread stacks, statics, etc.)
  • 72. ©2011 Azul Systems, Inc. Mark (aka “Trace”) Start from “roots” (thread stacks, statics, etc.) “Paint” anything you can reach as “live”
  • 73. ©2011 Azul Systems, Inc. Mark (aka “Trace”) Start from “roots” (thread stacks, statics, etc.) “Paint” anything you can reach as “live” At the end of a mark pass: all reachable objects will be marked “live” all non-reachable objects will be marked “dead” (aka “non-live”).
  • 74. ©2011 Azul Systems, Inc. Mark (aka “Trace”) Start from “roots” (thread stacks, statics, etc.) “Paint” anything you can reach as “live” At the end of a mark pass: all reachable objects will be marked “live” all non-reachable objects will be marked “dead” (aka “non-live”). Note: work is generally linear to “live set”
  • 75. ©2011 Azul Systems, Inc. Sweep
  • 76. ©2011 Azul Systems, Inc. Sweep Scan through the heap, identify “dead” objects and track them somehow (usually in some form of free list)
  • 77. ©2011 Azul Systems, Inc. Sweep Scan through the heap, identify “dead” objects and track them somehow (usually in some form of free list) Note: work is generally linear to heap size
  • 78. ©2011 Azul Systems, Inc. Compact
  • 79. ©2011 Azul Systems, Inc. Compact Over time, heap will get “swiss cheesed”: contiguous dead space between objects may not be large enough to fit new objects (aka “fragmentation”)
  • 80. ©2011 Azul Systems, Inc. Compact Over time, heap will get “swiss cheesed”: contiguous dead space between objects may not be large enough to fit new objects (aka “fragmentation”) Compaction moves live objects together to reclaim contiguous empty space (aka “relocate”)
  • 81. ©2011 Azul Systems, Inc. Compact Over time, heap will get “swiss cheesed”: contiguous dead space between objects may not be large enough to fit new objects (aka “fragmentation”) Compaction moves live objects together to reclaim contiguous empty space (aka “relocate”) Compaction has to correct all object references to point to new object locations (aka “remap”)
  • 82. ©2011 Azul Systems, Inc. Compact Over time, heap will get “swiss cheesed”: contiguous dead space between objects may not be large enough to fit new objects (aka “fragmentation”) Compaction moves live objects together to reclaim contiguous empty space (aka “relocate”) Compaction has to correct all object references to point to new object locations (aka “remap”) Remap scan must cover all references that could possibly point to relocated objects
  • 83. ©2011 Azul Systems, Inc. Compact Over time, heap will get “swiss cheesed”: contiguous dead space between objects may not be large enough to fit new objects (aka “fragmentation”) Compaction moves live objects together to reclaim contiguous empty space (aka “relocate”) Compaction has to correct all object references to point to new object locations (aka “remap”) Remap scan must cover all references that could possibly point to relocated objects Note: work is generally linear to “live set”
  • 84. ©2011 Azul Systems, Inc. Copy
  • 85. ©2011 Azul Systems, Inc. Copy A copying collector moves all lives objects from a “from” space to a “to” space & reclaims “from” space
  • 86. ©2011 Azul Systems, Inc. Copy A copying collector moves all lives objects from a “from” space to a “to” space & reclaims “from” space At start of copy, all objects are in “from” space and all references point to “from” space.
  • 87. ©2011 Azul Systems, Inc. Copy A copying collector moves all lives objects from a “from” space to a “to” space & reclaims “from” space At start of copy, all objects are in “from” space and all references point to “from” space. Start from “root” references, copy any reachable object to “to” space, correcting references as we go
  • 88. ©2011 Azul Systems, Inc. Copy A copying collector moves all lives objects from a “from” space to a “to” space & reclaims “from” space At start of copy, all objects are in “from” space and all references point to “from” space. Start from “root” references, copy any reachable object to “to” space, correcting references as we go At end of copy, all objects are in “to” space, and all references point to “to” space
  • 89. ©2011 Azul Systems, Inc. Copy A copying collector moves all lives objects from a “from” space to a “to” space & reclaims “from” space At start of copy, all objects are in “from” space and all references point to “from” space. Start from “root” references, copy any reachable object to “to” space, correcting references as we go At end of copy, all objects are in “to” space, and all references point to “to” space Note: work generally linear to “live set”
  • 90. Mark/Sweep/Compact, Copy, Mark/Compact ©2011 Azul Systems, Inc.
  • 91. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable ©2011 Azul Systems, Inc.
  • 92. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable Mark/Sweep/Compact only requires 1x (plus some) ©2011 Azul Systems, Inc.
  • 93. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable Mark/Sweep/Compact only requires 1x (plus some) Copy and Mark/Compact are linear only to live set ©2011 Azul Systems, Inc.
  • 94. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable Mark/Sweep/Compact only requires 1x (plus some) Copy and Mark/Compact are linear only to live set Mark/Sweep/Compact linear (in sweep) to heap size ©2011 Azul Systems, Inc.
  • 95. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable Mark/Sweep/Compact only requires 1x (plus some) Copy and Mark/Compact are linear only to live set Mark/Sweep/Compact linear (in sweep) to heap size Mark/Sweep/(Compact) may be able to avoid some moving work ©2011 Azul Systems, Inc.
  • 96. Mark/Sweep/Compact, Copy, Mark/Compact Copy requires 2x the max. live set to be reliable Mark/Sweep/Compact only requires 1x (plus some) Copy and Mark/Compact are linear only to live set Mark/Sweep/Compact linear (in sweep) to heap size Mark/Sweep/(Compact) may be able to avoid some moving work Copying is [typically] “monolithic” ©2011 Azul Systems, Inc.
  • 97. ©2011 Azul Systems, Inc. Generational Collection Young Generation Old Generation
  • 98. ©2011 Azul Systems, Inc. Generational Collection Young Generation Old Generation new object
  • 99. ©2011 Azul Systems, Inc. Generational Collection Young Generation Old Generation new object very large new object
  • 100. ©2011 Azul Systems, Inc. Copy Collection Old Generation
  • 101. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 102. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 103. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space Starting 1st young gen collection
  • 104. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 105. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 106. ©2011 Azul Systems, Inc. Copy Collection After 1st young gen collection Old Generation “From” space “To” space
  • 107. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 108. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 109. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space Starting 2nd young gen collection
  • 110. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 111. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 112. ©2011 Azul Systems, Inc. Copy Collection After 2nd young gen collection “From” Old Generation space “To” space
  • 113. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 114. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space After Nth young gen collection
  • 115. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 116. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space Starting N+1 st young gen collection
  • 117. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space Starting N+1 st young gen collection
  • 118. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space Starting N+1 st young gen collection
  • 119. ©2011 Azul Systems, Inc. Copy Collection Old Generation “From” space “To” space
  • 120. ©2011 Azul Systems, Inc. Generational Collection
  • 121. ©2011 Azul Systems, Inc. Generational Collection Weak Generational Hypothesis; “most objects die young”
  • 122. ©2011 Azul Systems, Inc. Generational Collection Weak Generational Hypothesis; “most objects die young” Focus collection efforts on young generation: Use a moving collector: work is linear to the live set The live set in the young generation is a small % of the space Promote objects that live long enough to older generations
  • 123. ©2011 Azul Systems, Inc. Generational Collection Weak Generational Hypothesis; “most objects die young” Focus collection efforts on young generation: Use a moving collector: work is linear to the live set The live set in the young generation is a small % of the space Promote objects that live long enough to older generations Only collect older generations as they fill up “Generational filter” reduces rate of allocation into older generations
  • 124. ©2011 Azul Systems, Inc. Generational Collection Weak Generational Hypothesis; “most objects die young” Focus collection efforts on young generation: Use a moving collector: work is linear to the live set The live set in the young generation is a small % of the space Promote objects that live long enough to older generations Only collect older generations as they fill up “Generational filter” reduces rate of allocation into older generations Tends to be (order of magnitude) more efficient Great way to keep up with high allocation rate Practical necessity for keeping up with processor throughput
  • 125. ©2011 Azul Systems, Inc. Marking in Young gen problem Young Generation Old Generation
  • 126. ©2011 Azul Systems, Inc. Marking in Young gen problem Young Generation Old Generation Root set
  • 127. ©2011 Azul Systems, Inc. Marking in Young gen problem Young Generation Old Generation Root set
  • 128. ©2011 Azul Systems, Inc. Marking in Young gen problem Young Generation Old Generation Root set
  • 129. ©2011 Azul Systems, Inc. Marking in Young gen solution Young Generation Old Generation
  • 130. ©2011 Azul Systems, Inc. Marking in Young gen solution Young Generation Old Generation
  • 131. ©2011 Azul Systems, Inc. Generational Collection
  • 132. ©2011 Azul Systems, Inc. Generational Collection Requires a “Remembered set”: a way to track all references into the young generation from the outside
  • 133. ©2011 Azul Systems, Inc. Generational Collection Requires a “Remembered set”: a way to track all references into the young generation from the outside Remembered set is also part of “roots” for young generation collection
  • 134. ©2011 Azul Systems, Inc. Generational Collection Requires a “Remembered set”: a way to track all references into the young generation from the outside Remembered set is also part of “roots” for young generation collection No need for 2x the live set: Can “spill over” to old gen
  • 135. ©2011 Azul Systems, Inc. Generational Collection Requires a “Remembered set”: a way to track all references into the young generation from the outside Remembered set is also part of “roots” for young generation collection No need for 2x the live set: Can “spill over” to old gen Usually want to keep surviving objects in young generation for a while before promoting them to the old generation Immediate promotion can significantly reduce gen. filter efficiency Waiting too long to promote can eliminate generational benefits
  • 136. ©2011 Azul Systems, Inc. How does the remembered set work?
  • 137. How does the remembered set work? Generational collectors require a “Remembered set”: a way to track all references into the young generation from the outside ©2011 Azul Systems, Inc.
  • 138. How does the remembered set work? Generational collectors require a “Remembered set”: a way to track all references into the young generation from the outside Each store of a NewGen reference into and OldGen object needs to be intercepted and tracked ©2011 Azul Systems, Inc.
  • 139. How does the remembered set work? Generational collectors require a “Remembered set”: a way to track all references into the young generation from the outside Each store of a NewGen reference into and OldGen object needs to be intercepted and tracked Common technique: “Card Marking” A bit (or byte) indicating a word (or region) in OldGen is “suspect” ©2011 Azul Systems, Inc.
  • 140. How does the remembered set work? Generational collectors require a “Remembered set”: a way to track all references into the young generation from the outside Each store of a NewGen reference into and OldGen object needs to be intercepted and tracked Common technique: “Card Marking” A bit (or byte) indicating a word (or region) in OldGen is “suspect” Write barrier used to track references Common technique (e.g. HotSpot): blind stores on reference write Variants: precise vs. imprecise card marking, conditional vs. non-conditional ©2011 Azul Systems, Inc.
  • 141. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMS
  • 142. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMS Young generation usually uses a copying collector
  • 143. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMS Young generation usually uses a copying collector Young generation is usually monolithic, stop-the-world
  • 144. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMS Young generation usually uses a copying collector Young generation is usually monolithic, stop-the-world Old generation usually uses Mark/Sweep/Compact
  • 145. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMS Young generation usually uses a copying collector Young generation is usually monolithic, stop-the-world Old generation usually uses Mark/Sweep/Compact Old generation may be STW, or Concurrent, or mostly-Concurrent, or Incremental-STW, or mostly- Incremental-STW
  • 146. ©2011 Azul Systems, Inc. Empty memory and CPU/throughput
  • 147. CPU% Heap size Heap size vs. GC CPU %
  • 148. CPU% 100% Heap size Live set Heap size vs. GC CPU %
  • 149. CPU% 100% Heap size Live set Heap size vs. GC CPU %
  • 150. ©2011 Azul Systems, Inc. Two Intuitive limits
  • 151. ©2011 Azul Systems, Inc. Two Intuitive limits If we had exactly 1 byte of empty memory at all times, the collector would have to work “very hard”, and GC would take 100% of the CPU time
  • 152. ©2011 Azul Systems, Inc. Two Intuitive limits If we had exactly 1 byte of empty memory at all times, the collector would have to work “very hard”, and GC would take 100% of the CPU time If we had infinite empty memory, we would never have to collect, and GC would take 0% of the CPU time
  • 153. ©2011 Azul Systems, Inc. Two Intuitive limits If we had exactly 1 byte of empty memory at all times, the collector would have to work “very hard”, and GC would take 100% of the CPU time If we had infinite empty memory, we would never have to collect, and GC would take 0% of the CPU time GC CPU % will follow a rough 1/x curve between these two limit points, dropping as the amount of memory increases.
  • 154. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power)
  • 155. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power) The amount of empty memory in the heap is the dominant factor controlling the amount of GC work
  • 156. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power) The amount of empty memory in the heap is the dominant factor controlling the amount of GC work For both Copy and Mark/Compact collectors, the amount of work per cycle is linear to live set
  • 157. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power) The amount of empty memory in the heap is the dominant factor controlling the amount of GC work For both Copy and Mark/Compact collectors, the amount of work per cycle is linear to live set The amount of memory recovered per cycle is equal to the amount of unused memory (heap size - live set)
  • 158. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power) The amount of empty memory in the heap is the dominant factor controlling the amount of GC work For both Copy and Mark/Compact collectors, the amount of work per cycle is linear to live set The amount of memory recovered per cycle is equal to the amount of unused memory (heap size - live set) The collector has to perform a GC cycle when the empty memory runs out
  • 159. ©2011 Azul Systems, Inc. Empty memory needs (empty memory == CPU power) The amount of empty memory in the heap is the dominant factor controlling the amount of GC work For both Copy and Mark/Compact collectors, the amount of work per cycle is linear to live set The amount of memory recovered per cycle is equal to the amount of unused memory (heap size - live set) The collector has to perform a GC cycle when the empty memory runs out A Copy or Mark/Compact collector’s efficiency doubles with every doubling of the empty memory
  • 160. ©2011 Azul Systems, Inc. What empty memory controls
  • 161. ©2011 Azul Systems, Inc. What empty memory controls Empty memory controls efficiency (amount of collector work needed per amount of application work performed)
  • 162. ©2011 Azul Systems, Inc. What empty memory controls Empty memory controls efficiency (amount of collector work needed per amount of application work performed) Empty memory controls the frequency of pauses (if the collector performs any Stop-the-world operations)
  • 163. ©2011 Azul Systems, Inc. What empty memory controls Empty memory controls efficiency (amount of collector work needed per amount of application work performed) Empty memory controls the frequency of pauses (if the collector performs any Stop-the-world operations) Empty memory DOES NOT control pause times (only their frequency)
  • 164. ©2011 Azul Systems, Inc. What empty memory controls Empty memory controls efficiency (amount of collector work needed per amount of application work performed) Empty memory controls the frequency of pauses (if the collector performs any Stop-the-world operations) Empty memory DOES NOT control pause times (only their frequency) In Mark/Sweep/Compact collectors that pause for sweeping, more empty memory means less frequent but LARGER pauses
  • 165. ©2011 Azul Systems, Inc. Some non monolithic-STW stuff
  • 166. ©2011 Azul Systems, Inc. Concurrent Marking
  • 167. ©2011 Azul Systems, Inc. Concurrent Marking Mark all reachable objects as “live”, but object graph is “mutating” under us.
  • 168. ©2011 Azul Systems, Inc. Concurrent Marking Mark all reachable objects as “live”, but object graph is “mutating” under us. Classic concurrent marking race: mutator may move reference that has not yet been seen by the marker into an object that has already been visited If not intercepted or prevented in some way, will corrupt the heap
  • 169. ©2011 Azul Systems, Inc. Concurrent Marking Mark all reachable objects as “live”, but object graph is “mutating” under us. Classic concurrent marking race: mutator may move reference that has not yet been seen by the marker into an object that has already been visited If not intercepted or prevented in some way, will corrupt the heap Example technique: track mutations, multi-pass marking Track reference mutations during mark (e.g. in card table) Re-visit all mutated references (and track new mutations) When set is “small enough”, do a STW catch up (mostly concurrent)
  • 170. ©2011 Azul Systems, Inc. Concurrent Marking Mark all reachable objects as “live”, but object graph is “mutating” under us. Classic concurrent marking race: mutator may move reference that has not yet been seen by the marker into an object that has already been visited If not intercepted or prevented in some way, will corrupt the heap Example technique: track mutations, multi-pass marking Track reference mutations during mark (e.g. in card table) Re-visit all mutated references (and track new mutations) When set is “small enough”, do a STW catch up (mostly concurrent) Note: work grows with mutation rate, may fail to finish
  • 171. ©2011 Azul Systems, Inc. Incremental Compaction
  • 172. ©2011 Azul Systems, Inc. Incremental Compaction Track cross-region remembered sets (which region points to which)
  • 173. ©2011 Azul Systems, Inc. Incremental Compaction Track cross-region remembered sets (which region points to which) To compact a single region, only need to scan regions that point into it to remap all potential references
  • 174. ©2011 Azul Systems, Inc. Incremental Compaction Track cross-region remembered sets (which region points to which) To compact a single region, only need to scan regions that point into it to remap all potential references identify regions sets that fit in limited time Each such set of regions is a Stop-the-World increment Safe to run application between (but not within) increments
  • 175. ©2011 Azul Systems, Inc. Incremental Compaction Track cross-region remembered sets (which region points to which) To compact a single region, only need to scan regions that point into it to remap all potential references identify regions sets that fit in limited time Each such set of regions is a Stop-the-World increment Safe to run application between (but not within) increments Note: work can grow with the square of the heap size The number of regions pointing into a single region is generally linear to the heap size (the number of regions in the heap)
  • 176. ©2011 Azul Systems, Inc. Delaying the inevitable
  • 177. ©2011 Azul Systems, Inc. Delaying the inevitable Some form of copying/compaction is inevitable in practice And compacting anything requires scanning/fixing all references to it
  • 178. ©2011 Azul Systems, Inc. Delaying the inevitable Some form of copying/compaction is inevitable in practice And compacting anything requires scanning/fixing all references to it Delay tactics focus on getting “easy empty space” first This is the focus for the vast majority of GC tuning
  • 179. ©2011 Azul Systems, Inc. Delaying the inevitable Some form of copying/compaction is inevitable in practice And compacting anything requires scanning/fixing all references to it Delay tactics focus on getting “easy empty space” first This is the focus for the vast majority of GC tuning Most objects die young [Generational] So collect young objects only, as much as possible. Hope for short STW. But eventually, some old dead objects must be reclaimed
  • 180. ©2011 Azul Systems, Inc. Delaying the inevitable Some form of copying/compaction is inevitable in practice And compacting anything requires scanning/fixing all references to it Delay tactics focus on getting “easy empty space” first This is the focus for the vast majority of GC tuning Most objects die young [Generational] So collect young objects only, as much as possible. Hope for short STW. But eventually, some old dead objects must be reclaimed Most old dead space can be reclaimed without moving it [e.g. CMS] track dead space in lists, and reuse it in place But eventually, space gets fragmented, and needs to be moved
  • 181. ©2011 Azul Systems, Inc. Delaying the inevitable Some form of copying/compaction is inevitable in practice And compacting anything requires scanning/fixing all references to it Delay tactics focus on getting “easy empty space” first This is the focus for the vast majority of GC tuning Most objects die young [Generational] So collect young objects only, as much as possible. Hope for short STW. But eventually, some old dead objects must be reclaimed Most old dead space can be reclaimed without moving it [e.g. CMS] track dead space in lists, and reuse it in place But eventually, space gets fragmented, and needs to be moved Much of the heap is not “popular” [e.g. G1, “Balanced”] A non popular region will only be pointed to from a small % of the heap So compact non-popular regions in short stop-the-world pauses But eventually, popular objects and regions need to be compacted Young generation pauses are only small because heaps are tiny A 200GB heap will regularly have several GB of live young stuff…
  • 182. ©2011 Azul Systems, Inc. Classifying common collectors
  • 183. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMs
  • 184. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMs Young generation usually uses a copying collector Young generation is usually monolithic, stop-the-world
  • 185. ©2011 Azul Systems, Inc. The typical combos in commercial server JVMs Young generation usually uses a copying collector Young generation is usually monolithic, stop-the-world Old generation usually uses a Mark/Sweep/Compact collector Old generation may be STW, or Concurrent, or mostly-Concurrent, or Incremental-STW, or mostly-Incremental-STW
  • 186. ©2011 Azul Systems, Inc. HotSpot™ ParallelGC Collector mechanism classification
  • 187. ©2011 Azul Systems, Inc. HotSpot™ ParallelGC Collector mechanism classification Monolithic Stop-the-world copying NewGen
  • 188. ©2011 Azul Systems, Inc. HotSpot™ ParallelGC Collector mechanism classification Monolithic Stop-the-world copying NewGen Monolithic Stop-the-world Mark/Sweep/Compact OldGen
  • 189. HotSpot™ ConcMarkSweepGC (aka CMS) ©2011 Azul Systems, Inc. Collector mechanism classification
  • 190. HotSpot™ ConcMarkSweepGC (aka CMS) ©2011 Azul Systems, Inc. Collector mechanism classification Monolithic Stop-the-world copying NewGen (ParNew)
  • 191. HotSpot™ ConcMarkSweepGC (aka CMS) ©2011 Azul Systems, Inc. Collector mechanism classification Monolithic Stop-the-world copying NewGen (ParNew) Mostly Concurrent, non-compacting OldGen (CMS) Mostly Concurrent marking Mark concurrently while mutator is running Track mutations in card marks Revisit mutated cards (repeat as needed) Stop-the-world to catch up on mutations, ref processing, etc. Concurrent Sweeping Does not Compact (maintains free list, does not move objects)
  • 192. HotSpot™ ConcMarkSweepGC (aka CMS) ©2011 Azul Systems, Inc. Collector mechanism classification Monolithic Stop-the-world copying NewGen (ParNew) Mostly Concurrent, non-compacting OldGen (CMS) Mostly Concurrent marking Mark concurrently while mutator is running Track mutations in card marks Revisit mutated cards (repeat as needed) Stop-the-world to catch up on mutations, ref processing, etc. Concurrent Sweeping Does not Compact (maintains free list, does not move objects) Fallback to Full Collection (Monolithic Stop the world). Used for Compaction, etc.
  • 193. ©2011 Azul Systems, Inc. HotSpot™ G1GC (aka “Garbage First”) Collector mechanism classification
  • 194. ©2011 Azul Systems, Inc. HotSpot™ G1GC (aka “Garbage First”) Collector mechanism classification Monolithic Stop-the-world copying NewGen
  • 195. ©2011 Azul Systems, Inc. HotSpot™ G1GC (aka “Garbage First”) Collector mechanism classification Monolithic Stop-the-world copying NewGen Mostly Concurrent, OldGen marker Mostly Concurrent marking Stop-the-world to catch up on mutations, ref processing, etc. Tracks inter-region relationships in remembered sets
  • 196. ©2011 Azul Systems, Inc. HotSpot™ G1GC (aka “Garbage First”) Collector mechanism classification Monolithic Stop-the-world copying NewGen Mostly Concurrent, OldGen marker Mostly Concurrent marking Stop-the-world to catch up on mutations, ref processing, etc. Tracks inter-region relationships in remembered sets Stop-the-world mostly incremental compacting old gen Objective: “Avoid, as much as possible, having a Full GC…” Compact sets of regions that can be scanned in limited time Delay compaction of popular objects, popular regions
  • 197. ©2011 Azul Systems, Inc. HotSpot™ G1GC (aka “Garbage First”) Collector mechanism classification Monolithic Stop-the-world copying NewGen Mostly Concurrent, OldGen marker Mostly Concurrent marking Stop-the-world to catch up on mutations, ref processing, etc. Tracks inter-region relationships in remembered sets Stop-the-world mostly incremental compacting old gen Objective: “Avoid, as much as possible, having a Full GC…” Compact sets of regions that can be scanned in limited time Delay compaction of popular objects, popular regions Fallback to Full Collection (Monolithic Stop the world). Used for compacting popular objects, popular regions, etc.
  • 198. ©2011 Azul Systems, Inc. The “Application Memory Wall” or: Why stop-the-world garbage collection is a problem
  • 199. ©2011 Azul Systems, Inc. Memory use How many of you use heap sizes of: F more than ½ GB? F more than 1 GB? F more than 2 GB? F more than 4 GB? F more than 10 GB? F more than 20 GB? F more than 50 GB? F more than 100 GB?
  • 201. Reality check: servers in 2014 Retail prices, major web server store (US $, circa 2014) 24 vCore, 128GB server ≈ $4K 32 vCore, 256GB server ≈ $8K 32 vCore, 384GB server ≈ $10K 64 vCore, 1TB server ≈ $24K
  • 202. Reality check: servers in 2014 Retail prices, major web server store (US $, circa 2014) 24 vCore, 128GB server ≈ $4K 32 vCore, 256GB server ≈ $8K 32 vCore, 384GB server ≈ $10K 64 vCore, 1TB server ≈ $24K Cheap (< $1/GB/Month), and roughly linear to ~1TB
  • 203. Reality check: servers in 2014 Retail prices, major web server store (US $, circa 2014) 24 vCore, 128GB server ≈ $4K 32 vCore, 256GB server ≈ $8K 32 vCore, 384GB server ≈ $10K 64 vCore, 1TB server ≈ $24K Cheap (< $1/GB/Month), and roughly linear to ~1TB 10s to 100s of GB/sec of memory bandwidth
  • 204. The Application Memory Wall ©2011 Azul Systems, Inc. A simple observation:
  • 205. The Application Memory Wall ©2011 Azul Systems, Inc. A simple observation: Application instances appear to be unable to make effective use of modern server memory capacities
  • 206. The Application Memory Wall ©2011 Azul Systems, Inc. A simple observation: Application instances appear to be unable to make effective use of modern server memory capacities The size of application instances as a % of a server’s capacity is rapidly dropping
  • 207. How much memory do applications need? ©2011 Azul Systems, Inc.
  • 208. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc.
  • 209. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG!
  • 210. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG! So what’s the right number?
  • 211. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG! So what’s the right number? 6,400K? 64,000K? 640,000K? 6,400,000K? 64,000,000K?
  • 212. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG! So what’s the right number? 6,400K? 64,000K? 640,000K? 6,400,000K? 64,000,000K? There is no right number
  • 213. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG! So what’s the right number? 6,400K? 64,000K? 640,000K? 6,400,000K? 64,000,000K? There is no right number “I've said some stupid things and some wrong things, but not that. No one involved in computers would ever say that a certain amount of memory is enough for all time …” - Bill Gates, 1996
  • 214. How much memory do applications need? “640KB ought to be enough for anybody” ©2011 Azul Systems, Inc. WRONG! So what’s the right number? 6,400K? 64,000K? 640,000K? 6,400,000K? 64,000,000K? There is no right number Target moves at 50x-100x per decade “I've said some stupid things and some wrong things, but not that. No one involved in computers would ever say that a certain amount of memory is enough for all time …” - Bill Gates, 1996
  • 215. ©2011 Azul Systems, Inc. “Tiny” application history
  • 216. ©2011 Azul Systems, Inc. “Tiny” application history “Tiny”: would be “silly” to distribute
  • 217. ©2011 Azul Systems, Inc. “Tiny” application history Assuming Moore’s Law means: “transistor counts grow at ≈2x every ≈18 months” It also means memory size grows ≈100x every 10 years “Tiny”: would be “silly” to distribute
  • 218. ©2011 Azul Systems, Inc. “Tiny” application history Assuming Moore’s Law means: “transistor counts grow at ≈2x every ≈18 months” It also means memory size grows ≈100x every 10 years 2010 2000 1990 1980 “Tiny”: would be “silly” to distribute
  • 219. Assuming Moore’s Law means: “transistor counts grow at ≈2x It also means memory size grows ≈100x every 10 years ©2011 Azul Systems, Inc. “Tiny” application history every ≈18 months” 2010 2000 1990 100KB apps on a ¼ to ½ MB Server 1980 “Tiny”: would be “silly” to distribute
  • 220. Assuming Moore’s Law means: “transistor counts grow at ≈2x It also means memory size grows ≈100x every 10 years ©2011 Azul Systems, Inc. “Tiny” application history 2010 2000 10MB apps on a 32 – 64 MB server every ≈18 months” 1990 100KB apps on a ¼ to ½ MB Server 1980 “Tiny”: would be “silly” to distribute
  • 221. Assuming Moore’s Law means: “transistor counts grow at ≈2x It also means memory size grows ≈100x every 10 years ©2011 Azul Systems, Inc. “Tiny” application history 2010 1GB apps on a 2 – 4 GB server 2000 10MB apps on a 32 – 64 MB server every ≈18 months” 1990 100KB apps on a ¼ to ½ MB Server 1980 “Tiny”: would be “silly” to distribute
  • 222. ©2011 Azul Systems, Inc. “Tiny” application history 1GB apps on a 2 – 4 GB server 10MB apps on a 32 – 64 MB server 100KB apps on a ¼ to ½ MB Server ??? GB apps on 256 GB Assuming Moore’s Law means: “transistor counts grow at ≈2x every ≈18 months” It also means memory size grows ≈100x every 10 years 2010 2000 1990 1980 “Tiny”: would be “silly” to distribute
  • 223. ©2011 Azul Systems, Inc. “Tiny” application history 1GB apps on a 2 – 4 GB server 10MB apps on a 32 – 64 MB server 100KB apps on a ¼ to ½ MB Server ??? GB apps on 256 GB Assuming Moore’s Law means: “transistor counts grow at ≈2x every ≈18 months” It also means memory size grows ≈100x every 10 years 2010 2000 1990 1980 “Tiny”: would be “silly” to distribute
  • 224. ©2011 Azul Systems, Inc. “Tiny” application history Application Memory Wall 1GB apps on a 2 – 4 GB server 10MB apps on a 32 – 64 MB server 100KB apps on a ¼ to ½ MB Server ??? GB apps on 256 GB Assuming Moore’s Law means: “transistor counts grow at ≈2x every ≈18 months” It also means memory size grows ≈100x every 10 years 2010 2000 1990 1980 “Tiny”: would be “silly” to distribute
  • 225. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall?
  • 226. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall? Garbage Collection is a clear and dominant cause
  • 227. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall? Garbage Collection is a clear and dominant cause There seem to be practical heap size limits for applications with responsiveness requirements
  • 228. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall? Garbage Collection is a clear and dominant cause There seem to be practical heap size limits for applications with responsiveness requirements [Virtually] All current commercial JVMs will exhibit a multi-second pause on a normally utilized 2-6GB heap. It’s a question of “When” and “How often”, not “If”. GC tuning only moves the “when” and the “how often” around
  • 229. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall? Garbage Collection is a clear and dominant cause There seem to be practical heap size limits for applications with responsiveness requirements [Virtually] All current commercial JVMs will exhibit a multi-second pause on a normally utilized 2-6GB heap. It’s a question of “When” and “How often”, not “If”. GC tuning only moves the “when” and the “how often” around Root cause: The link between scale and responsiveness
  • 230. ©2012 Azul Systems, Inc. What is causing the Application Memory Wall? Garbage Collection is a clear and dominant cause There seem to be practical heap size limits for applications with responsiveness requirements [Virtually] All current commercial JVMs will exhibit a multi-second pause on a normally utilized 2-6GB heap. It’s a question of “When” and “How often”, not “If”. GC tuning only moves the “when” and the “how often” around Root cause: The link between scale and responsiveness
  • 231. What quality of GC is responsible for the Application Memory Wall?
  • 232. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization
  • 233. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization It is NOT about speed Average speeds, 90%, 95% speeds, are all perfectly fine
  • 234. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization It is NOT about speed Average speeds, 90%, 95% speeds, are all perfectly fine It is NOT about minor GC events (right now) GC events in the 10s of msec are usually tolerable for most apps
  • 235. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization It is NOT about speed Average speeds, 90%, 95% speeds, are all perfectly fine It is NOT about minor GC events (right now) GC events in the 10s of msec are usually tolerable for most apps It is NOT about the frequency of very large pauses
  • 236. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization It is NOT about speed Average speeds, 90%, 95% speeds, are all perfectly fine It is NOT about minor GC events (right now) GC events in the 10s of msec are usually tolerable for most apps It is NOT about the frequency of very large pauses It is ALL about the worst observable pause behavior People avoid building/deploying visibly broken systems
  • 237. What quality of GC is responsible for the Application Memory Wall? It is NOT about overhead or efficiency: CPU utilization, bottlenecks, memory consumption and utilization It is NOT about speed Average speeds, 90%, 95% speeds, are all perfectly fine It is NOT about minor GC events (right now) GC events in the 10s of msec are usually tolerable for most apps It is NOT about the frequency of very large pauses It is ALL about the worst observable pause behavior People avoid building/deploying visibly broken systems
  • 238. ©2011 Azul Systems, Inc. Monolithic-STW GC Problems
  • 239. One way to deal with Monolithic-STW GC
  • 240. Another way to cope: Creative Language ©2012 Azul Systems, Inc.
  • 241. Another way to cope: Creative Language “Guarantee a worst case of X msec, 99% of the time” ©2012 Azul Systems, Inc.
  • 242. Another way to cope: Creative Language “Guarantee a worst case of X msec, 99% of the time” “Mostly” Concurrent, “Mostly” Incremental Translation: “Will at times exhibit long monolithic stop-the- ©2012 Azul Systems, Inc. world pauses”
  • 243. Another way to cope: Creative Language “Guarantee a worst case of X msec, 99% of the time” “Mostly” Concurrent, “Mostly” Incremental Translation: “Will at times exhibit long monolithic stop-the- world pauses” “Fairly Consistent” Translation: “Will sometimes show results well outside this range” ©2012 Azul Systems, Inc.
  • 244. Another way to cope: Creative Language “Guarantee a worst case of X msec, 99% of the time” “Mostly” Concurrent, “Mostly” Incremental Translation: “Will at times exhibit long monolithic stop-the- world pauses” “Fairly Consistent” Translation: “Will sometimes show results well outside this range” “Typical pauses in the tens of milliseconds” Translation: “Some pauses are much longer than tens of milliseconds” ©2012 Azul Systems, Inc.
  • 245. ©2012 Azul Systems, Inc. Actually measuring things
  • 246.
  • 247. ©2012 Azul Systems, Inc. Incontinuities in Java platform execution 1800" 1600" 1400" 1200" 1000" 800" 600" 400" 200" 0" Hiccups"by"Time"Interval" Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 200" 400" 600" 800" 1000" 1200" 1400" 1600" 1800" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Max=1665.024& Hiccups"by"Percen@le"Distribu@on" 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 1800" 1600" 1400" 1200" 1000" 800" 600" 400" 200" 0" Hiccup&Dura*on&(msec)& && Percen*le&
  • 248. 14000" 12000" 10000" 8000" 6000" 4000" 2000" 14000" 12000" 10000" 8000" 6000" 4000" 2000" ©2013 Azul Systems, Inc. Oracle HotSpot CMS, 1GB in an 8GB heap 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=13156.352& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& && Percen*le& Zing 5, 1GB in an 8GB heap 25" 20" 15" 10" 5" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=20.384& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 25" 20" 15" 10" 5" 0" Hiccup&Dura*on&(msec)& && Percen*le&
  • 249. 14000" 12000" 10000" 8000" 6000" 4000" 2000" 14000" 12000" 10000" 8000" 6000" 4000" 2000" ©2013 Azul Systems, Inc. Oracle HotSpot CMS, 1GB in an 8GB heap 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=13156.352& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& && Percen*le& Zing 5, 1GB in an 8GB heap 25" 20" 15" 10" 5" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=20.384& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 25" 20" 15" 10" 5" 0" Hiccup&Dura*on&(msec)& && Percen*le&
  • 250. 14000" 12000" 10000" 8000" 6000" 4000" 2000" 14000" 12000" 10000" 8000" 6000" 4000" 2000" ©2013 Azul Systems, Inc. Oracle HotSpot CMS, 1GB in an 8GB heap 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=13156.352& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& && Percen*le& Zing 5, 1GB in an 8GB heap 14000" 12000" 10000" 8000" 6000" 4000" 2000" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 500" 1000" 1500" 2000" 2500" 3000" 3500" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& 0%" Max9=02%0".384& 99%" 99.9%" 99.99%" 99.999%" 99.9999%" 14000" 12000" 10000" 8000" 6000" 4000" 2000" 0" Hiccup&Dura*on&(msec)& && Percen*le& Drawn to scale
  • 251. Oracle HotSpot (pure newgen) 25" 20" 15" 10" 5" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& 25" 20" 15" 10" 5" ©2013 Azul Systems, Inc. &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=22.656& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& & & Percen*le& Low latency trading application
  • 252. Oracle HotSpot (pure newgen) Zing 25" 20" 15" 10" 5" 25" 20" 15" 10" 5" ©2013 Azul Systems, Inc. 1.8" 1.6" 1.4" 1.2" 1" 0.8" 0.6" 0.4" 0.2" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=1.568& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 1.8" 1.6" 1.4" 1.2" 1" 0.8" 0.6" 0.4" 0.2" 0" Hiccup&Dura*on&(msec)& & & Percen*le& 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=22.656& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& & & Percen*le& Low latency trading application
  • 253. Oracle HotSpot (pure newgen) Zing 25" 20" 15" 10" 5" 25" 20" 15" 10" 5" ©2013 Azul Systems, Inc. 1.8" 1.6" 1.4" 1.2" 1" 0.8" 0.6" 0.4" 0.2" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=1.568& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 1.8" 1.6" 1.4" 1.2" 1" 0.8" 0.6" 0.4" 0.2" 0" Hiccup&Dura*on&(msec)& & & Percen*le& 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=22.656& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& & & Percen*le& Low latency trading application
  • 254. Oracle HotSpot (pure newgen) Zing 25" 20" 15" 10" 5" 25" 20" 15" 10" 5" ©2013 Azul Systems, Inc. 25" 20" 15" 10" 5" 0" Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Hiccups&by&Percen*le&Distribu*on& Max=1.568& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 25" 20" 15" 10" 5" 0" Hiccup&Dura*on&(msec)& Hiccups&by&Time&Interval& Max"per"Interval" 99%" 99.90%" 99.99%" Max" Hiccups&by&Percen*le&Distribu*on& Low latency - Drawn to scale & & Percen*le& 0" 0" 100" 200" 300" 400" 500" 600" Hiccup&Dura*on&(msec)& &Elapsed&Time&(sec)& Max=22.656& 0%" 90%" 99%" 99.9%" 99.99%" 99.999%" 0" Hiccup&Dura*on&(msec)& & & Percen*le&
  • 255. Comparing latency behavior under different throughputs, configurations 90# 80# 70# 60# 50# 40# 30# 20# 10# ©2013 Azul Systems, Inc. latency sensitive messaging distribution application 0%# 90%# 99%# 99.9%# 99.99%# 99.999%# 0# Latency((milliseconds)( ( ( HotSpot&15K& Required& Service&Level& Percen3le( Latency(by(Percen3le(Distribu3on( HotSpot&10K&&& HotSpot&5K& HotSpot&1K& Zing&15K& Zing&10K& Zing&5K& Zing&1K& &
  • 256. ©2011 Azul Systems, Inc. Sustainable Throughput: The throughput achieved while safely maintaining service levels
  • 257. ©2011 Azul Systems, Inc. Sustainable Throughput: The throughput achieved while safely maintaining service levels
  • 258. ©2011 Azul Systems, Inc. Sustainable Throughput: The throughput achieved while safely maintaining service levels Unsustainable Throughout
  • 259. ©2011 Azul Systems, Inc. Getting past a monolithic-STW Garbage Collection world
  • 260. ©2011 Azul Systems, Inc. We need to solve the right problems
  • 261. ©2011 Azul Systems, Inc. We need to solve the right problems Scale is artificially limited by responsiveness
  • 262. ©2011 Azul Systems, Inc. We need to solve the right problems Scale is artificially limited by responsiveness Responsiveness must be unlinked from scale: Heap size, Live Set size, Allocation rate, Mutation rate Transaction Rate, Concurrent users, Data set size, etc. Responsiveness must be continually sustainable Can’t ignore “rare” events
  • 263. ©2011 Azul Systems, Inc. We need to solve the right problems Scale is artificially limited by responsiveness Responsiveness must be unlinked from scale: Heap size, Live Set size, Allocation rate, Mutation rate Transaction Rate, Concurrent users, Data set size, etc. Responsiveness must be continually sustainable Can’t ignore “rare” events Eliminate all Stop-The-World Fallbacks At modern server scales, any STW fall back is a failure
  • 264. ©2011 Azul Systems, Inc. We need to solve the right problems Scale is artificially limited by responsiveness Responsiveness must be unlinked from scale: Heap size, Live Set size, Allocation rate, Mutation rate Transaction Rate, Concurrent users, Data set size, etc. Responsiveness must be continually sustainable Can’t ignore “rare” events Eliminate all Stop-The-World Fallbacks At modern server scales, any STW fall back is a failure
  • 265. ©2011 Azul Systems, Inc. The problems that need solving (areas where the state of the art needs improvement)
  • 266. The problems that need solving (areas where the state of the art needs improvement) Robust Concurrent Marking In the presence of high mutation and allocation rates Cover modern runtime semantics (e.g. weak refs, lock deflation) ©2011 Azul Systems, Inc.
  • 267. The problems that need solving (areas where the state of the art needs improvement) Robust Concurrent Marking In the presence of high mutation and allocation rates Cover modern runtime semantics (e.g. weak refs, lock deflation) Compaction that is not monolithic-stop-the-world E.g. stay responsive while compacting ¼ TB heaps Must be robust: not just a tactic to delay STW compaction [current “incremental STW” attempts fall short on robustness] ©2011 Azul Systems, Inc.
  • 268. The problems that need solving (areas where the state of the art needs improvement) Robust Concurrent Marking In the presence of high mutation and allocation rates Cover modern runtime semantics (e.g. weak refs, lock deflation) Compaction that is not monolithic-stop-the-world E.g. stay responsive while compacting ¼ TB heaps Must be robust: not just a tactic to delay STW compaction [current “incremental STW” attempts fall short on robustness] Young-Gen that is not monolithic-stop-the-world Stay responsive while promoting multi-GB data spikes Concurrent or “incremental STW” may both be ok Surprisingly little work done in this specific area ©2011 Azul Systems, Inc.
  • 269. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector
  • 270. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing
  • 271. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing Concurrent Compactor Objects moved without stopping mutator References remapped without stopping mutator Can relocate entire generation (New, Old) in every GC cycle
  • 272. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing Concurrent Compactor Objects moved without stopping mutator References remapped without stopping mutator Can relocate entire generation (New, Old) in every GC cycle Concurrent, compacting old generation
  • 273. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing Concurrent Compactor Objects moved without stopping mutator References remapped without stopping mutator Can relocate entire generation (New, Old) in every GC cycle Concurrent, compacting old generation Concurrent, compacting new generation
  • 274. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing Concurrent Compactor Objects moved without stopping mutator References remapped without stopping mutator Can relocate entire generation (New, Old) in every GC cycle Concurrent, compacting old generation Concurrent, compacting new generation No stop-the-world fallback Always compacts, and always does so concurrently
  • 275. ©2011 Azul Systems, Inc. Azul’s “C4” Collector Continuously Concurrent Compacting Collector Concurrent guaranteed-single-pass marker Oblivious to mutation rate Concurrent ref (weak, soft, final) processing Concurrent Compactor Objects moved without stopping mutator References remapped without stopping mutator Can relocate entire generation (New, Old) in every GC cycle Concurrent, compacting old generation Concurrent, compacting new generation No stop-the-world fallback Always compacts, and always does so concurrently
  • 276. ©2011 Azul Systems, Inc. C4 algorithm highlights
  • 277. ©2011 Azul Systems, Inc. C4 algorithm highlights Same core mechanism used for both generations Concurrent Mark-Compact
  • 278. ©2011 Azul Systems, Inc. C4 algorithm highlights Same core mechanism used for both generations Concurrent Mark-Compact A Loaded Value Barrier (LVB) is central to the algorithm Every heap reference is verified as “sane” when loaded “Non-sane” refs are caught and fixed in a self-healing barrier
  • 279. ©2011 Azul Systems, Inc. C4 algorithm highlights Same core mechanism used for both generations Concurrent Mark-Compact A Loaded Value Barrier (LVB) is central to the algorithm Every heap reference is verified as “sane” when loaded “Non-sane” refs are caught and fixed in a self-healing barrier Refs that have not yet been “marked through” are caught Guaranteed single pass concurrent marker
  • 280. ©2011 Azul Systems, Inc. C4 algorithm highlights Same core mechanism used for both generations Concurrent Mark-Compact A Loaded Value Barrier (LVB) is central to the algorithm Every heap reference is verified as “sane” when loaded “Non-sane” refs are caught and fixed in a self-healing barrier Refs that have not yet been “marked through” are caught Guaranteed single pass concurrent marker Refs that point to relocated objects are caught Lazily (and concurrently) remap refs, no hurry Relocation and remapping are both concurrent
  • 281. ©2011 Azul Systems, Inc. C4 algorithm highlights Same core mechanism used for both generations Concurrent Mark-Compact A Loaded Value Barrier (LVB) is central to the algorithm Every heap reference is verified as “sane” when loaded “Non-sane” refs are caught and fixed in a self-healing barrier Refs that have not yet been “marked through” are caught Guaranteed single pass concurrent marker Refs that point to relocated objects are caught Lazily (and concurrently) remap refs, no hurry Relocation and remapping are both concurrent Uses “quick release” to recycle memory Forwarding information is kept outside of object pages Physical memory released immediately upon relocation “Hand-over-hand” compaction without requiring empty memory
  • 282. ©2011 Azul Systems, Inc. Benefits ELIMINATES Garbage Collection as a concern for enterprise applications
  • 283. ©2011 Azul Systems, Inc. GC Tuning
  • 284. Some GC tuning flags (although some are absolute now) Source: Word Cloud created by Frank Pavageau in his Devoxx FR 2012 presentaGon Gtled “Death by Pauses”
  • 285. ©2011 Azul Systems, Inc. Java GC tuning is “hard”…
  • 286. ©2011 Azul Systems, Inc. Java GC tuning is “hard”… Examples of actual command line GC tuning parameters:
  • 287. ©2011 Azul Systems, Inc. Java GC tuning is “hard”… Examples of actual command line GC tuning parameters: Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g -XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 -XX:LargePageSizeInBytes=256m …
  • 288. ©2011 Azul Systems, Inc. Java GC tuning is “hard”… Examples of actual command line GC tuning parameters: Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g -XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 -XX:LargePageSizeInBytes=256m … Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M -XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled -XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
  • 289. ©2011 Azul Systems, Inc. Java GC tuning is “hard”… Examples of actual command line GC tuning parameters: Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g -XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 -XX:LargePageSizeInBytes=256m … Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M -XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled -XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
  • 290. ©2011 Azul Systems, Inc. Java GC tuning is “hard”… Examples of actual command line GC tuning parameters: Java -Xmx12g -XX:MaxPermSize=64M -XX:PermSize=32M -XX:MaxNewSize=2g -XX:NewSize=1g -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:ParallelGCThreads=12 -XX:LargePageSizeInBytes=256m … Java –Xms8g –Xmx8g –Xmn2g -XX:PermSize=64M -XX:MaxPermSize=256M -XX:-OmitStackTraceInFastThrow -XX:SurvivorRatio=2 -XX:-UseAdaptiveSizePolicy -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSParallelRemarkEnabled -XX:+CMSParallelSurvivorRemarkEnabled -XX:CMSMaxAbortablePrecleanTime=10000 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=63 -XX:+UseParNewGC –Xnoclassgc …
  • 291. ©Systems, Inc. ©2013 Azul Systems, Inc. The complete guide to modern GC tuning**
  • 292. ©Systems, Inc. ©2013 Azul Systems, Inc. The complete guide to modern GC tuning** java -Xmx40g
  • 293. ©Systems, Inc. ©2013 Azul Systems, Inc. The complete guide to modern GC tuning** java -Xmx40g java -Xmx20g
  • 294. ©Systems, Inc. ©2013 Azul Systems, Inc. The complete guide to modern GC tuning** java -Xmx40g java -Xmx20g java -Xmx10g
  • 295. ©Systems, Inc. ©2013 Azul Systems, Inc. The complete guide to modern GC tuning** java -Xmx40g java -Xmx20g java -Xmx10g java -Xmx5g
  • 296. ©2013 Azul Systems, Inc. An overview Azul & Zing
  • 297. ©2013 Azul Systems, Inc. An overview Azul & Zing
  • 298. ©2013 Azul Systems, Inc. About Azul
  • 299. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines
  • 300. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002
  • 301. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega)
  • 302. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Vega
  • 303. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Vega
  • 304. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Zing: Pure software for commodity x86 Vega
  • 305. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Zing: Pure software for commodity x86 Vega C4
  • 306. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Zing: Pure software for commodity x86 Known for Low Latency, Consistent execution, and Large data set excellence Vega C4
  • 307. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul
  • 308. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs
  • 309. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs C4
  • 310. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs Zing: A metrically better JVM C4
  • 311. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs Zing: A metrically better JVM Zulu: A commercialized, fully supported version of OpenJDK C4
  • 312. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs Zing: A metrically better JVM Zulu: A commercialized, fully supported version of OpenJDK Long term, commercial support for Java SE 6, Java SE 7, (and 8 as it comes out) C4
  • 313. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs Zing: A metrically better JVM Zulu: A commercialized, fully supported version of OpenJDK Long term, commercial support for Java SE 6, Java SE 7, (and 8 as it comes out) Zulu: Free & Open Source, changes contributed back to OpenJDK C4
  • 314. ©©2013 Azul Systems, Systems, Inc. Inc. About Azul We also do other things with JVMs Zing: A metrically better JVM Zulu: A commercialized, fully supported version of OpenJDK Long term, commercial support for Java SE 6, Java SE 7, (and 8 as it comes out) Zulu: Free & Open Source, changes contributed back to OpenJDK Windows & Linux, Azure & EC2 C4
  • 315. ©2013 Azul Systems, Inc. Zing
  • 316. ©2013 Azul Systems, Inc. Zing A JVM for Linux/x86 servers
  • 317. ©2013 Azul Systems, Inc. Zing A JVM for Linux/x86 servers ELIMINATES Garbage Collection as a concern for enterprise applications