Skip to content

Instantly share code, notes, and snippets.

@sim51
Last active December 18, 2015 08:09
Show Gist options
  • Save sim51/5752275 to your computer and use it in GitHub Desktop.
Save sim51/5752275 to your computer and use it in GitHub Desktop.
Présentation du #nunuxpro du 10/06/2013 à 20h à la cantine de Nantes#hype
@charset "UTF-8";
/**********************************************
* GENERAL STYLES
*********************************************/
body{
background:url("http://hype.kissr.com/jvm_generation/background.png") no-repeat bottom #000000;
background-size: 100%;
color: #FFFFFF;
font-size:0.9em;
}
.reveal section img{
border : none;
background: none;
}
.reveal section strong {
color: #13DAEC;
}
footer {
position:fixed;
bottom:10px;
font-size:0.5em !important;
z-index:999;
}
.reveal ol, .reveal ul {
list-style: none outside none;
}
.reveal section .footnote {
font-size: 0.7em;
font-style: italic;
margin-top: 100px;
display:block;
}
.reveal section h1{
font-size:1.8em;
margin-bottom: 40px;
}
.reveal section *{
text-align:center;
}
.reveal section ul,.reveal section ul li, .reveal section ul li * {
text-align:left;
}
.reveal section ul.center,
.reveal section ul.center li,
.reveal section ul.center li * {
text-align:center;
}
.reveal section ul li{
margin-top:20px;
margin-bottom:20px;
}
.reveal section blockquote{
font-size:0.7em;
width:100%;
}
.reveal section blockquote.small{
font-size:0.5em;
text-align:left;
}
.reveal section p.comment{
text-align:left;
font-size:0.7em;
color:green;
}
.reveal section div.code *{
text-align:left;
}
div#footer{
position:fixed;
bottom: 10px;
left: 50px;
}
.important {color: #FF0000 !important;}
/* Table */
.reveal table { border-collapse: collapse; border-spacing: 0;}
.reveal table, .reveal table tr {width:100%; background-color:#2C3539;border: 5px solid #000000;}
.reveal table td {text-align:center;border: 5px solid #000000;}
.reveal section ul.listH > li {
display:block;
float:left;
margin-left: 50px;
}
/**********************************************
* D3.js Style
**********************************************/
text {
font-size: 1em;
font-weight: bold;
fill: white;
}
.byteCode path {
fill: #848482;
}
.compiler path {
fill: #C11B17;
}
.profiler path {
fill: #1569C7;
}
.optimiser path {
fill: #F87217;
}
.ring path {
fill: #FFFFFF;
}
/**********************************************
* JVM STYLE FOR MEMORY
*********************************************/
#JVM {
height: 500px;
background-color: #3D577A;
background-image: linear-gradient(to bottom, #FFFFFF, #808080);
border: 1px solid #FFFFFF;
}
#permgen {
height: 58px;
padding: 20px;
background-color: #3D577A;
background-image: linear-gradient(to bottom, #000000, #0000FF);
border-bottom: 1px solid #FFFFFF;
}
#heap {
height: 100px;
background-color: #FFFF00;
background-image: linear-gradient(to bottom, #0000FF, #F70D1A, #FFFF00);
}
.heap #heap {
padding: 150px;
}
#old {
height: 100px;
padding: 100px;
background-color: #F70D1A;
background-image: linear-gradient(to bottom, #0000FF, #F70D1A);
border-bottom: 1px solid #FFFFFF;
}
#young{
height: 58px;
padding: 20px;
background-color: #FFFF00;
background-image: linear-gradient(to bottom, #F70D1A, #FFFF00);
}
.eden #young {
height : 57px;
border-top : 1px solid #FFFFFF;
}
/**********************************************
* JVM STYLE FOR GC
*********************************************/
#genYoung {
clear:both;
height: 100px;
background-image: linear-gradient(to bottom, #FFFFFF, #808080);
}
#genYoung div, #genOld div {
height:100%;
float: left;
border-left: 3px solid #000000;
}
#genEden {}
#survivor0 {}
#survivor1 {}
#genOld {
height: 100px;
background-image: linear-gradient(to bottom, #FFFFFF, #808080);
}
.title {
color: #FFFFFF;
position: relative;
top : 20px;
}
.bar {
height : 100%;
}
.item { background-color:#00FF00;border-left:none !important;}
#survivor0 .item, #survivor1 .item { background-color: #F87217;}
.reveal section table .gc {font-size:0.7em;font-weight:normal;}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Génération JVM</title>
<meta name="description" content="Présentation du #nunuxpro du 10/06/2013 à 20h à la cantine de Nantes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://lab.hakim.se/reveal-js/css/reveal.min.css">
<link rel="stylesheet" href="http://lab.hakim.se/reveal-js/css/theme/default.css" id="theme">
<link rel="Stylesheet" href="https://rawgithub.com/sim51/5752275/raw/Génération%20JVM.css" />
<script>
document.write( '<link rel="stylesheet" href="http://lab.hakim.se/reveal-js/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<![endif]-->
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>JVM generation</h1>
<img src="http://hype.kissr.com/jvm_generation/evolution.jpeg" />
<p>
<small>
By <a href="http://www.bsimard.com">Benoît Simard</a>
/ <a href="http://twitter.com/logisima">@logisima</a>
</small>
</p>
</section>
<section>
<section>
<h1>Compile once, run everywhere</h1>
<img src="http://hype.kissr.com/jvm_generation/device.png"/>
<blockquote>Since 1996</blockquote>
</section>
<section>
<h1>Byte code machine</h1>
<blockquote>Code => Compiler => Byte Code</blockquote>
<img src="http://hype.kissr.com/jvm_generation/jvm_langages.png"/>
</section>
<section>
<h1>Virtual Machine</h1>
<div id="gears"></div>
<script type="text/javascript">
var w = 960,
h = 500,
r = 80,
x = Math.sin(2 * Math.PI / 3),
y = Math.cos(2 * Math.PI / 3),
speed = 4,
start = Date.now();
var svg = d3.select("#gears").insert("svg:svg", "form")
.attr("width", w)
.attr("height", h)
.append("svg:g")
.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")scale(.55)")
.append("svg:g")
.data([{radius: Infinity}]);
svg.append("svg:g")
.attr("class", "ring")
.data([{teeth: 80, radius: -r * 5, ring: true}])
.append("svg:path")
.attr("class", "gear")
.attr("d", gear);
var byteCode = svg.append("svg:g")
.attr("class", "byteCode")
.data([{teeth: 16, radius: r}])
.append("svg:g")
.attr("class", "gear");
byteCode.append("svg:path")
.attr("d", gear);
var compiler = svg.append("svg:g")
.attr("class", "compiler")
.attr("transform", "translate(0,-" + r * 3 + ")")
.data([{teeth: 32, radius: -r * 2}])
.append("svg:g")
.attr("class", "gear");
compiler.append("svg:path")
.attr("d", gear);
compiler.append("svg:text")
.attr("x", -r-20)
.attr("y", -r/2)
.attr("dy", ".31em")
.attr("text-anchor", "start")
.attr("transform", "rotate(45)")
.text("Compiler (JIT)");
var profiler = svg.append("svg:g")
.attr("class", "profiler")
.attr("transform", "translate(" + -r * 3 * x + "," + -r * 3 * y + ")")
.data([{teeth: 32, radius: -r * 2}])
.append("svg:g")
.attr("class", "gear");
profiler.append("svg:path")
.attr("d", gear);
profiler.append("svg:text")
.attr("x", -r+20)
.attr("y", -r/2)
.attr("dy", ".31em")
.attr("text-anchor", "start")
.attr("transform", "rotate(45)")
.text("Profiler");
var optimiser = svg.append("svg:g")
.attr("class", "optimiser")
.attr("transform", "translate(" + r * 3 * x + "," + -r * 3 * y + ")")
.data([{teeth: 32, radius: -r * 2}])
.append("svg:g")
.attr("class", "gear");
optimiser.append("svg:path")
.attr("d", gear);
optimiser.append("svg:text")
.attr("x", -r)
.attr("y", -r/2)
.attr("dy", ".31em")
.attr("text-anchor", "start")
.attr("transform", "rotate(45)")
.text("Optimiser");
function gear(d) {
var n = d.teeth,
r2 = Math.abs(d.radius),
r0 = r2 - 8,
r1 = r2 + 8,
r3 = d.ring ? (r3 = r0, r0 = r1, r1 = r3, r2 + 20) : 20,
da = Math.PI / n,
a0 = -Math.PI / 2 + (d.ring ? Math.PI / n : 0),
i = -1,
path = ["M", r0 * Math.cos(a0), ",", r0 * Math.sin(a0)];
while (++i < n) path.push(
"A", r0, ",", r0, " 0 0,1 ", r0 * Math.cos(a0 += da), ",", r0 * Math.sin(a0),
"L", r2 * Math.cos(a0), ",", r2 * Math.sin(a0),
"L", r1 * Math.cos(a0 += da / 3), ",", r1 * Math.sin(a0),
"A", r1, ",", r1, " 0 0,1 ", r1 * Math.cos(a0 += da / 3), ",", r1 * Math.sin(a0),
"L", r2 * Math.cos(a0 += da / 3), ",", r2 * Math.sin(a0),
"L", r0 * Math.cos(a0), ",", r0 * Math.sin(a0));
path.push("M0,", -r3, "A", r3, ",", r3, " 0 0,0 0,", r3, "A", r3, ",", r3, " 0 0,0 0,", -r3, "Z");
return path.join("");
}
d3.timer(function() {
var angle = (Date.now() - start) * speed,
transform = function(d) { return "rotate(" + angle / d.radius + ")"; };
svg.selectAll(".gear").attr("transform", transform);
svg.attr("transform", transform); // fixed ring
});
</script>
</section>
</section>
<section>
<section>
<h1>JVM memory</h1>
<img src="http://hype.kissr.com/jvm_generation/java.png"/>
</section>
<section>
<h1>PermGen</h1>
<blockquote>Class metadata, interned String, ...</blockquote>
<div id="JVM">
<div id="permgen">Permanent (PermGen)</div>
<img style="margin-top: 50px;" src="http://hype.kissr.com/jvm_generation/java.png"/>
</div>
</section>
<section class="heap">
<h1>Heap</h1>
<blockquote>Application Objects</blockquote>
<div id="JVM">
<div id="permgen">Permanent (PermGen)</div>
<div id="heap">Heap</div>
</div>
</section>
<section class="oldyoung">
<h1>Old / Young</h1>
<div id="JVM">
<div id="permgen">Permanent (PermGen)</div>
<div id="heap">
<div id="old">Old / Tenured</div>
<div id="young">Young / New</div>
</div>
</div>
</section>
<section>
<h1>Most of object die young !</h1>
<img style="margin-top: 50px;" src="http://hype.kissr.com/jvm_generation/die_young.jpg"/>
</section>
<section>
<h1>JVM is generational !</h1>
<img style="margin-top: 50px;" src="http://hype.kissr.com/jvm_generation/K7.png"/>
</section>
</section>
<section>
<section>
<h1>Life Cycle memory</h1>
<img src="http://hype.kissr.com/jvm_generation/java.png"/>
</section>
<section class="eden">
<h1>Eden, survivor 0 & 1</h1>
<div id="JVM">
<div id="permgen">Permanent (PermGen)</div>
<div id="heap">
<div id="old">Old / Tenured</div>
<div id="young">
<div id="eden" style="float:left;width:80%;">Eden</div>
<div id="survivor0" style="float:left;width:9%;">S0</div>
<div id="survivor1" style="float:left;width:10%;">S1</div>
</div>
</div>
</div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;"> </div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:40%;">
<span class="title">Allocation</span>
</div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:70%;">
<span class="title">Allocation</span>
</div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:100%;">
<span class="title important">100% = GC !</span>
</div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>Object without a reference are deleted</h4>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="background-image: linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<div style="width:5%;" class="bar"></div>
<div style="width:1%;" class="bar item"></div>
<div style="width:15%;" class="bar"></div>
<div style="width:5%;" class="bar item"></div>
<div style="width:25%;" class="bar"></div>
<div style="width:13%;" class="bar item"></div>
<div style="width:20%;"></div>
<div style="width:8%;" class="bar"></div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>First generation !</h4>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="background-image: linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<psan class="title">RAZ</psan>
</div>
<div id="survivor0" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:33%;">
<span class="title ">Allocation</span>
</div>
</div>
<div id="survivor0" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:100%;">
<span class="title important">GC !</span>
</div>
</div>
<div id="survivor0" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>Object without a reference are deleted</h4>
<h5>In Eden & Survivor 0</h5>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="background-image:linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<div style="width:5%;" class="bar"></div>
<div style="width:1%;" class="bar item"></div>
<div style="width:15%;" class="bar"></div>
<div style="width:5%;" class="bar item"></div>
<div style="width:25%;" class="bar"></div>
<div style="width:13%;" class="bar item"></div>
<div style="width:20%;"></div>
<div style="width:8%;" class="bar"></div>
</div>
<div id="survivor0" style="width:10%;background-image:linear-gradient(to bottom, #000000, #2C3539)">
<div style="width:20%;" class="bar"></div>
<div style="width:5%;" class="bar item"></div>
<div style="width:40%;" class="bar"></div>
<div style="width:20%;" class="bar item"></div>
</div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>Second generation !</h4>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="background-image: linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<span class="title">RAZ</span>
</div>
<div id="survivor0" style="width:10%;background-image: linear-gradient(to bottom, #000000, #2C3539);"></div>
<div id="survivor1" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:33%;">
<span class="title">Allocation</span>
</div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="width:78%;">
<div class="bar item" style="width:100%;">
<span class="title important">GC !</span>
</div>
</div>
<div id="survivor0" style="width:10%;"></div>
<div id="survivor1" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>Object without a reference are deleted</h4>
<h5>In Eden & Survivor 1</h5>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung" style="background-image:linear-gradient(to bottom, #000000, #2C3539);">
<div id="genEden" style="background-image:linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<div style="width:5%;" class="bar"></div>
<div style="width:1%;" class="bar item"></div>
<div style="width:15%;" class="bar"></div>
<div style="width:5%;" class="bar item"></div>
<div style="width:25%;" class="bar"></div>
<div style="width:13%;" class="bar item"></div>
<div style="width:20%;"></div>
<div style="width:8%;" class="bar"></div>
</div>
<div id="survivor0" style="width:10%;background-image: linear-gradient(to bottom, #FFFFFF, #808080);">
</div>
<div id="survivor1" style="width:10%;background-image:linear-gradient(to bottom, #000000, #2C3539)">
<div style="width:20%;" class="bar"></div>
<div style="width:5%;" class="bar item"></div>
<div style="width:40%;" class="bar"></div>
<div style="width:20%;" class="bar item"></div>
<div style="width:15%;" class="bar"></div>
</div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld"></div>
</section>
<section>
<h4>First generation ' !</h4>
<h4>Promotion to old for survivor 1</h4>
<br/>
<div>
<div style="width:78%;float:left">Eden</div>
<div style="width:10%;float:left">S0</div>
<div style="width:10%;float:left">S1</div>
</div>
<div id="genYoung">
<div id="genEden" style="background-image: linear-gradient(to bottom, #000000, #2C3539);width:78%;">
<span class="title">RAZ</span>
</div>
<div id="survivor0" style="width:10%;">
<div style="width:75%;" class="bar item"></div>
</div>
<div id="survivor1" style="width:10%;"></div>
</div>
<br/><br/>
<div>Old</div>
<div id="genOld">
<div style="width:5%;" class="bar item"></div>
</div>
</section>
<section>
<h3>2 generation to have "old object"</h3>
<img src="http://hype.kissr.com/jvm_generation/repeat.png"/>
</section>
<section>
<div>Old</div>
<div id="genOld">
<div style="width:75%;" class="bar item">
<span class="title important">Pretty full = Full GC !</span>
</div>
</div>
</section>
<section>
<h4>Object without a reference are deleted</h4>
<br/>
<div>Old</div>
<div id="genOld" style="background-image: linear-gradient(to bottom, #000000, #2C3539);">
<div style="width:2%;" class="bar item"></div>
<div style="width:17%;" class="bar"></div>
<div style="width:3%;" class="bar item"></div>
<div style="width:23%;" class="bar"></div>
<div style="width:8%;" class="bar item"></div>
<div style="width:20%;" class="bar"></div>
<div style="width:1%;" class="bar item"></div>
</div>
</section>
<section>
<h4>Compact (optional)</h4>
<br/>
<div>Old</div>
<div id="genOld">
<div style="width:2%;" class="bar item"></div>
<div style="width:3%;" class="bar item"></div>
<div style="width:8%;" class="bar item"></div>
<div style="width:1%;" class="bar item"></div>
</div>
</section>
</section>
<section>
<section>
<h1>Garbage Collector</h1>
<img src="http://hype.kissr.com/jvm_generation/java.png"/>
</section>
<section>
<h1>GC stop all the world !</h1>
<img src="http://hype.kissr.com/jvm_generation/freeze.jpg"/>
<blockquote>
Freeze, don't move !
</blockquote>
</section>
<section>
<h1>3 Types</h1>
<ul class="listH">
<li>
<strong>Serial</strong>
<ul>
<li>Blocking</li>
<li>Mono-thread</li>
</ul>
</li>
<li>
<strong>Parallel</strong>
<ul>
<li>Blocking</li>
<li>Multi-thread</li>
</ul>
</li>
<li>
<strong>Concurrent</strong>
<ul>
<li>None-blocking</li>
<li>Multi-thread</li>
</ul>
</li>
</ul>
</section>
<section>
<h1>GC compatibilty</h1>
<table>
<tr>
<td colspan="2" style="background-color:#000000;"/>
<td colspan="2" style="background-color:#000000;">Young</td>
</tr>
<tr>
<td colspan="2" style="background-color:#000000;"/>
<td style="background-color:#848482;">Serial</td>
<td style="background-color:#848482;">Parallel</td>
</tr>
<tr>
<td style="background-color:#000000;">O</td>
<td style="background-color:#848482;">Serial</td>
<td>Serial<br/><span class="gc">-XX:+UseSerialGC</span></td>
<td>Parallel (default)<br/><span class="gc">-XX:+UseParallelGC</span></td>
</tr>
<tr>
<td style="background-color:#000000;">l</td>
<td style="background-color:#848482;">Parallel</td>
<td style="background-color:#C11B17;">N/A</td>
<td>ParallelOld<br/><span class="gc">-XX:+UseParallelOldGC</span></td>
</tr>
<tr>
<td style="background-color:#000000;">d</td>
<td style="background-color:#848482;">Concurrent</td>
<td>CMS Serial</td>
<td>CMS<br/><span class="gc">-XX:+UseConcMarkSweepGC</span></td>
</tr>
</table>
</section>
<section>
<h1 style="text-transform:none;">ParallelOld</h1>
<blockquote>
Retrieve more memory in less time
</blockquote>
<ul>
<li>
<strong>Young</strong>
<ul>
<li>Strategy <u>Mark & Evacuate</u></li>
<li>The execution time is proportional with the number of
object alive</li>
<li>Overhead is calculated in <u>ten milliseconds</u></li>
</ul>
</li>
<li>
<strong>Old</strong>
<ul>
<li>Strategy <u>Mark, Sweep & Compact</u></li>
<li>The execution time is proportional with the heap size</li>
<li>Overhead is calculated in <u>seconds</u></li>
</ul>
</li>
</ul>
</section>
<section>
<h1>Mark, Sweep & Compact</h1>
<div id="genOld">
<div style="width:75%;" class="bar item">
<span class="title important">GC !</span>
</div>
</div>
<br/>
<blockquote><strong>Marked & sweep: </strong>Alive objects are marked, and others are <strong>deleted</strong></blockquote>
<div id="genOld" style="background-image: linear-gradient(to bottom, #000000, #2C3539);">
<div style="width:2%;" class="bar item"></div>
<div style="width:17%;" class="bar"></div>
<div style="width:3%;" class="bar item"></div>
<div style="width:23%;" class="bar"></div>
<div style="width:8%;" class="bar item"></div>
<div style="width:20%;" class="bar"></div>
<div style="width:1%;" class="bar item"></div>
</div>
<br/>
<blockquote>
<strong>Compact: </strong>Object are <strong>moved</strong>. This only occured when there is not a sufficient space to insert an object.
</blockquote>
<div id="genOld">
<div style="width:2%;" class="bar item"></div>
<div style="width:3%;" class="bar item"></div>
<div style="width:8%;" class="bar item"></div>
<div style="width:1%;" class="bar item"></div>
</div>
</section>
<section>
<h1>Mark & Evacuate</h1>
<div id="genOld">
<div style="width:75%;" class="bar item">
<span class="title important">GC !</span>
</div>
</div>
<br/>
<blockquote><strong>Marked: </strong>Alive objects are marked (that's all !)</blockquote>
<div id="genOld" style="background-image: linear-gradient(to bottom, #000000, #2C3539);">
<div style="width:2%;background-color:red;" class="bar"></div>
<div style="width:17%;" class="bar item"></div>
<div style="width:3%;background-color:red;" class="bar"></div>
<div style="width:23%;" class="bar item"></div>
<div style="width:8%;background-color:red;" class="bar"></div>
<div style="width:20%;" class="bar item"></div>
<div style="width:1%;background-color:red;" class="bar"></div>
</div>
<br/>
<blockquote>
<strong>Evacuate: </strong>Objects are copied into a <strong>new memory</strong> and pointers references are rewritten
</blockquote>
<div id="genOld" style="background-image: linear-gradient(to bottom, #000000, #848482);">
<div style="width:2%;background-color:red;" class="bar"></div>
<div style="width:3%;background-color:red;" class="bar"></div>
<div style="width:8%;background-color:red;" class="bar"></div>
<div style="width:1%;background-color:red;" class="bar"></div>
</div>
</section>
<section>
<h1>CMS</h1>
<blockquote>
For real-time application
</blockquote>
<ul>
<li>
<strong>Young</strong>
<ul>
<li>Strategy <u>Mark & Evacuate</u></li>
<li>Overhead is calculated in <u>milliseconds</u></li>
</ul>
</li>
<li>
<strong>Old</strong>
<ul>
<li>Strategy <u>Mark, Sweep & Compact</u></li>
<li>Compact is done in last resort</li>
<li>No overhead (none blocking)</li>
</ul>
</li>
</ul>
<blockquote>
A CMS generation is fired when the young exceeds 45% (InitiatingHeapOccupancyPercent).
</blockquote>
</section>
<section>
<h1>Garbage first</h1>
<ul>
<li>Since java 1.7</li>
<li>Goal : no overhead that exceeds 300ms (-XX:MaxGCPauseMillis=300 )</li>
<li>-XX:UseG1GC</li>
</ul>
</section>
<section>
<h1>Garbage first</h1>
<img src="http://hype.kissr.com/jvm_generation/g1-allocation.png"/>
<ul>
<li>The heap is partitioned into a set of equal-sized heap regions</li>
<li>Each region can be an even, survivor or old (there s no fixe size)</li>
</ul>
</section>
<section>
<h1>Garbage first</h1>
<img src="http://hype.kissr.com/jvm_generation/g1-allocation.png"/>
</section>
</section>
<section>
<section>
<h1>JVM Tuning</h1>
<img src="http://hype.kissr.com/jvm_generation/java.png"/>
</section>
<section>
<h1>How many JVM param ?</h1>
<blockquote class="fragment">
More than 650 options ...
</blockquote>
<img class="fragment" src="http://hype.kissr.com/jvm_generation/cockpit.jpeg"/>
<blockquote class="fragment">
Monitoring & tuning !
</blockquote>
</section>
<section>
<h1>Indicators</h1>
<ul>
<li><strong>GC Time / Minute (mini, moy & max)</strong> &lt; 5% </li>
<li><strong>Number of GC / Minute</strong> if this indicator is high, you have a problem with the memory release or its size</li>
<li><strong>Number of Full GC</strong></li>
</ul>
</section>
<section>
<h1>Verbose GC</h1>
<blockquote>
-verbose:GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggs:/var/log/java/gc.log
</blockquote>
<img src="http://hype.kissr.com/jvm_generation/gc-log.png"/>
</section>
<section>
<h1>JVisualVM</h1>
<img src="http://hype.kissr.com/jvm_generation/jvisualvm.png"/>
</section>
<section>
<h1>Autopsy</h1>
<img src="http://hype.kissr.com/jvm_generation/brain.jpg"/>
</section>
<section>
<h1>HeapDump</h1>
<blockquote>
-XX:-HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/heapdump/
</blockquote>
<br/>
<blockquote>
jmap -J-d64 -heap<br/>
jmap -dump:format=b,file=heap.bin 15953<br/>
jhat -J-mx768m -stack false heap.bin
</blockquote>
</section>
<section>
<img src="http://hype.kissr.com/jvm_generation/pilote.png"/>
</section>
</section>
</div>
<footer>
Follow this presentation in live:
<a class="roll" href="http://bit.ly/13ym2LI">http://bit.ly/13ym2LI</a>
</footer>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/headjs/0.99/head.min.js"></script>
<script src="http://lab.hakim.se/reveal-js/js/reveal.min.js"></script>
<script type="text/javascript">
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: false, // don't set to true if you want to edit your prez with hype, because it reload the iframe
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'https://raw.github.com/hakimel/reveal.js/v2.3/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'https://raw.github.com/hakimel/reveal.js/v2.3/plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'https://raw.github.com/hakimel/reveal.js/v2.3/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
]
});
</script>
<!-- DO NOT REMOVE THE LINE ABOVE -->
<!-- ###HYPE_INJECTION_CODE### -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment