-
Notifications
You must be signed in to change notification settings - Fork 0
/
presentation.html
1238 lines (1052 loc) · 91.7 KB
/
presentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"><title>Unter der Haube: Die wichtigsten Neuerungen aus Java 17 bei Performance, Diagnostik & Tools</title><meta name="author" content="Benjamin Schmid @bentolor <[email protected]>"><link rel="stylesheet" href="reveal.js/css/reset.css"><link rel="stylesheet" href="reveal.js/css/reveal.css"><link rel="stylesheet" href="css/sky.css" id="theme"><!--This CSS is generated by the Asciidoctor reveal.js converter to further integrate AsciiDoc's existing semantic with reveal.js--><style type="text/css">.reveal div.right {
float: right
}
/* listing block */
.reveal .listingblock.stretch > .content {
height: 100%
}
.reveal .listingblock.stretch > .content > pre {
height: 100%
}
.reveal .listingblock.stretch > .content > pre > code {
height: 100%;
max-height: 100%
}
/* tables */
table {
border-collapse: collapse;
border-spacing: 0
}
table {
margin-bottom: 1.25em;
border: solid 1px #dedede
}
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td {
padding: .5em .625em .625em;
font-size: inherit;
text-align: left
}
table tr th, table tr td {
padding: .5625em .625em;
font-size: inherit
}
table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td {
display: table-cell;
line-height: 1.6
}
td.tableblock > .content {
margin-bottom: 1.25em
}
td.tableblock > .content > :last-child {
margin-bottom: -1.25em
}
table.tableblock, th.tableblock, td.tableblock {
border: 0 solid #dedede
}
table.grid-all > thead > tr > .tableblock, table.grid-all > tbody > tr > .tableblock {
border-width: 0 1px 1px 0
}
table.grid-all > tfoot > tr > .tableblock {
border-width: 1px 1px 0 0
}
table.grid-cols > * > tr > .tableblock {
border-width: 0 1px 0 0
}
table.grid-rows > thead > tr > .tableblock, table.grid-rows > tbody > tr > .tableblock {
border-width: 0 0 1px
}
table.grid-rows > tfoot > tr > .tableblock {
border-width: 1px 0 0
}
table.grid-all > * > tr > .tableblock:last-child, table.grid-cols > * > tr > .tableblock:last-child {
border-right-width: 0
}
table.grid-all > tbody > tr:last-child > .tableblock, table.grid-all > thead:last-child > tr > .tableblock, table.grid-rows > tbody > tr:last-child > .tableblock, table.grid-rows > thead:last-child > tr > .tableblock {
border-bottom-width: 0
}
table.frame-all {
border-width: 1px
}
table.frame-sides {
border-width: 0 1px
}
table.frame-topbot, table.frame-ends {
border-width: 1px 0
}
.reveal table th.halign-left, .reveal table td.halign-left {
text-align: left
}
.reveal table th.halign-right, .reveal table td.halign-right {
text-align: right
}
.reveal table th.halign-center, .reveal table td.halign-center {
text-align: center
}
.reveal table th.valign-top, .reveal table td.valign-top {
vertical-align: top
}
.reveal table th.valign-bottom, .reveal table td.valign-bottom {
vertical-align: bottom
}
.reveal table th.valign-middle, .reveal table td.valign-middle {
vertical-align: middle
}
table thead th, table tfoot th {
font-weight: bold
}
tbody tr th {
display: table-cell;
line-height: 1.6
}
tbody tr th, tbody tr th p, tfoot tr th, tfoot tr th p {
font-weight: bold
}
thead {
display: table-header-group
}
.reveal table.grid-none th, .reveal table.grid-none td {
border-bottom: 0 !important
}
/* kbd macro */
kbd {
font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace;
display: inline-block;
color: rgba(0, 0, 0, .8);
font-size: .65em;
line-height: 1.45;
background: #f7f7f7;
border: 1px solid #ccc;
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em white inset;
box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em #fff inset;
margin: 0 .15em;
padding: .2em .5em;
vertical-align: middle;
position: relative;
top: -.1em;
white-space: nowrap
}
.keyseq kbd:first-child {
margin-left: 0
}
.keyseq kbd:last-child {
margin-right: 0
}
/* callouts */
.conum[data-value] {
display: inline-block;
color: #fff !important;
background: rgba(0, 0, 0, .8);
-webkit-border-radius: 50%;
border-radius: 50%;
text-align: center;
font-size: .75em;
width: 1.67em;
height: 1.67em;
line-height: 1.67em;
font-family: "Open Sans", "DejaVu Sans", sans-serif;
font-style: normal;
font-weight: bold
}
.conum[data-value] * {
color: #fff !important
}
.conum[data-value] + b {
display: none
}
.conum[data-value]:after {
content: attr(data-value)
}
pre .conum[data-value] {
position: relative;
top: -.125em
}
b.conum * {
color: inherit !important
}
.conum:not([data-value]):empty {
display: none
}
/* Callout list */
.hdlist > table, .colist > table {
border: 0;
background: none
}
.hdlist > table > tbody > tr, .colist > table > tbody > tr {
background: none
}
td.hdlist1, td.hdlist2 {
vertical-align: top;
padding: 0 .625em
}
td.hdlist1 {
font-weight: bold;
padding-bottom: 1.25em
}
/* Disabled from Asciidoctor CSS because it caused callout list to go under the
* source listing when .stretch is applied (see #335)
* .literalblock+.colist,.listingblock+.colist{margin-top:-.5em} */
.colist td:not([class]):first-child {
padding: .4em .75em 0;
line-height: 1;
vertical-align: top
}
.colist td:not([class]):first-child img {
max-width: none
}
.colist td:not([class]):last-child {
padding: .25em 0
}
/* Override Asciidoctor CSS that causes issues with reveal.js features */
.reveal .hljs table {
border: 0
}
/* Callout list rows would have a bottom border with some reveal.js themes (see #335) */
.reveal .colist > table th, .reveal .colist > table td {
border-bottom: 0
}
/* Fixes line height with Highlight.js source listing when linenums enabled (see #331) */
.reveal .hljs table thead tr th, .reveal .hljs table tfoot tr th, .reveal .hljs table tbody tr td, .reveal .hljs table tr td, .reveal .hljs table tfoot tr td {
line-height: inherit
}
/* Columns layout */
.columns .slide-content {
display: flex;
}
.columns.wrap .slide-content {
flex-wrap: wrap;
}
.columns.is-vcentered .slide-content {
align-items: center;
}
.columns .slide-content > .column {
display: block;
flex-basis: 0;
flex-grow: 1;
flex-shrink: 1;
}
.columns .slide-content > .column > * {
padding: .75rem;
}
/* See #353 */
.columns.wrap .slide-content > .column {
flex-basis: auto;
}
.columns .slide-content > .column.is-full {
flex: none;
width: 100%;
}
.columns .slide-content > .column.is-four-fifths {
flex: none;
width: 80%;
}
.columns .slide-content > .column.is-three-quarters {
flex: none;
width: 75%;
}
.columns .slide-content > .column.is-two-thirds {
flex: none;
width: 66.6666%;
}
.columns .slide-content > .column.is-three-fifths {
flex: none;
width: 60%;
}
.columns .slide-content > .column.is-half {
flex: none;
width: 50%;
}
.columns .slide-content > .column.is-two-fifths {
flex: none;
width: 40%;
}
.columns .slide-content > .column.is-one-third {
flex: none;
width: 33.3333%;
}
.columns .slide-content > .column.is-one-quarter {
flex: none;
width: 25%;
}
.columns .slide-content > .column.is-one-fifth {
flex: none;
width: 20%;
}
.columns .slide-content > .column.has-text-left {
text-align: left;
}
.columns .slide-content > .column.has-text-justified {
text-align: justify;
}
.columns .slide-content > .column.has-text-right {
text-align: right;
}
.columns .slide-content > .column.has-text-left {
text-align: left;
}
.columns .slide-content > .column.has-text-justified {
text-align: justify;
}
.columns .slide-content > .column.has-text-right {
text-align: right;
}
.text-left {
text-align: left !important
}
.text-right {
text-align: right !important
}
.text-center {
text-align: center !important
}
.text-justify {
text-align: justify !important
}
.footnotes {
border-top: 1px solid rgba(0, 0, 0, 0.2);
padding: 0.5em 0 0 0;
font-size: 0.65em;
margin-top: 4em;
}
</style><link rel="stylesheet" href="./fonts/fontawesome/css/all.css"><!--Printing and PDF exports--><script>var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? "reveal.js/css/print/pdf.css" : "reveal.js/css/print/paper.css";
document.getElementsByTagName( 'head' )[0].appendChild( link );</script><link rel="stylesheet" href="css/presentation.css"></head><body><div class="reveal"><div class="slides"><section class="title" data-state="title"><h1>Unter der Haube</h1><h2>Die wichtigsten Neuerungen aus Java 17 bei Performance, Diagnostik & Tools</h2><div class="preamble"><aside class="notes"><div class="paragraph"><p>Vielen Dank …!</p></div>
<div class="paragraph"><p>Ja – hallo & Herzlich Willkommen… ich bin … und ich bin ein großer Freund der soliden, qualitativ hochwertigen und lösungsorientierte Softwareentwicklung. Das spiegelt sich auch darin, dass ich lange Jahre in Rollen wir Technology Advisor, Manager R&I und anderen oft erster Ansprechpartner in allen meth. & tech. Fragestellung war und bin.</p></div>
<div class="paragraph"><p>Mein Fokus liegt dabei im Bereich rund um Java & Web. Java 17 bringt wirklich <strong>viele</strong> <em>spannende</em> & <em>solide</em> Verbesserungen mit. Daher freue ich mich besonders über Java 17, da wir dank der LTS-Version die vielen spannenden Innovationen nun sicher bald besser in unser aller Projektpraxis nutzen können.</p></div>
<div class="paragraph"><p>In der heutigen Sessions stehten dabei weniger die Sprachfeatures im Vordergrund, sonder der Blick geht ein bisschen Richtung unter dei Haube und Tools.</p></div>
<div class="paragraph"><p>… ich denke die Vorfreude auf Java 17 lohnt sich, denn z.B. 3 Dinge die Java 17 unter der Haube mit sich bringt sind…</p></div></aside></div><p class="author"><small>Benjamin Schmid @bentolor <[email protected]></small></p></section>
<section><section id="_mehr_schwuppidizität" class="lightbg forcebottom" data-background-video="images/time-passes-by-so-quickly.mp4" data-background-video-loop data-background-opacity="1"><h2>Mehr <em>Schwuppidizität</em></h2><div class="slide-content"><aside class="notes"><div class="paragraph"><p>… durch <em>niedriglatente GCs</em> und schnellere JVM Start zur <em>Class-Data Sharing</em></p></div></aside></div></section><section id="_mehr_durchblick" class="lightbg forcebottom" data-background-video="images/pexels-cottonbro-9293441.mp4" data-background-video-loop data-background-opacity="1"><h2>Mehr Durchblick</h2><div class="slide-content"><aside class="notes"><div class="paragraph"><p>…mit <strong>tiefgreifenden Diagnostikmittel</strong>, allen voran dem JDK Flight Recorder und dem JDK Mission Control…</p></div></aside></div></section><section id="_mehr_hilfestellung" class="lightbg forcetop" data-background-video="images/pexels-koolshooters-7327408.mp4" data-background-video-loop data-background-opacity="1"><h2>Mehr Hilfestellung</h2><div class="slide-content"><aside class="notes"><div class="paragraph"><p>… z.B. durch <em>sprechende Nullpointer-Exceptions</em>, besseren Fehlermeldungen und bessere JVM Defaults</p></div></aside></div></section></section>
<section id="_agenda" class="lightbg" data-background-video="images/relaxing.mp4" data-background-video-loop data-background-video-muted data-background-opacity="0.5"><h2>Agenda</h2><div class="slide-content"><div class="olist arabic"><ol class="arabic"><li><p>Garbage Collectoren</p></li><li><p>Class-Data Sharing</p></li><li><p>Java Flight Recorder</p></li><li><p>Foreign Function & Memory</p></li><li><p>Tooling</p></li><li><p>Details & Maintenance</p></li></ol></div></div></section>
<section><section id="_garbage_collectoren" class="lightbg" data-background-video="images/garbage-collecting.mp4" data-background-video-loop data-background-video-muted data-background-opacity="0.9"><h2>Garbage Collectoren</h2><div class="slide-content"><aside class="notes"><div class="olist arabic"><ol class="arabic"><li><p>Kommen wir zum ersten Theme: GCs</p></li><li><p>Wichtiger Teil von Schwuppdizität</p></li><li><p>Zentral: Viele Verbesserung +2 neue GC Implementierungen</p></li><li><p>… aber ein blick auf: Was ist passiert?</p></li></ol></div></aside></div></section><section id="_timeline" class="degrade x-small"><h2>Timeline</h2><div class="slide-content"><table class="tableblock frame-none grid-vertical" style="width:60%"><colgroup><col style="width:16.6666%"><col style="width:83.3334%"></colgroup><tbody><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>11</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="decent"><span class="icon"><i class="fa fa-vial"></i></span></span> ZGC Experimental</p></td></tr><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>12</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="decent"><span class="icon"><i class="fa fa-vial"></i></span></span> Shenandoah Experimental<br>
<span class="decent"><span class="icon"><i class="fa fa-compress-alt"></i></span> G1 Uncommit Memory</span><br>
<span class="decent"><span class="icon"><i class="fa fa-undo"></i></span> ZGC Class Unloading</span></p></td></tr><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>13</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="decent"><span class="icon"><i class="fa fa-compress-alt"></i></span> ZGC Uncommit Memory</span></p></td></tr><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>14</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="icon"><i class="fa fa-windows"></i></span> & <span class="icon"><i class="fa fa-apple"></i></span> ZGC Support<br>
<span class="icon"><i class="fa fa-trash"></i></span> CMS Removal<br>
<span class="decent"><span class="icon"><i class="fa fa-bomb"></i></span> ParalellOldGC Deprecation</span></p></td></tr><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>15</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="icon"><i class="fa fa-award"></i></span> <strong>Shenandoah</strong> Production-ready<br>
<span class="icon"><i class="fa fa-award"></i></span> <strong>ZGC</strong> Production-ready</p></td></tr><tr><td class="tableblock halign-center valign-top"><p class="tableblock"><em>16</em></p></td><td class="tableblock halign-left valign-top"><p class="tableblock"><span class="decent"><span class="icon"><i class="fa fa-chart-line"></i></span> ZGC Improvements</span></p></td></tr></table></div></section><section id="_die_neue_generation_der_low_latency_gcs"><h2>Die neue Generation der Low-Latency GCs</h2><div class="slide-content"><div class="ulist"><ul><li><p>Moderne Architekturen: <em>Multi-Core</em> & <em>TB RAM</em></p></li><li><p><em>kurze GC Pausen</em> im ms-Bereich<br>
→ erkauft <strong>Responsiveness</strong> gegen <em>Durchsatz</em></p></li><li><p>(fast) vollständig <em>parallel & nebenläufig</em><br>
Pausen unabhängig von Größe des Heaps</p></li><li><p>Unterstützen <em>Class Unloading</em> & <em>Uncommit Memory</em></p></li><li><p>Einfach & Konfigurationsarm</p></li></ul></div>
<aside class="notes"><div class="ulist"><ul><li><p><em>Multi-Core</em> & <em>TB RAM</em></p></li><li><p>Ziel ist immer <strong>niedrige Latenz</strong></p></li><li><p>bei G1 & Co gerne mal 200~500ms; hier: 1-10ms;</p></li><li><p>Schnellere Reaktion geringere Gesamtdurchsatz & Damit längere Laufzeit</p></li></ul></div></aside></div></section><section id="_z_garbage_collector_zgc"><h2>Z Garbage Collector (ZGC)</h2><div class="slide-content"><div class="openblock col2"><div class="content"><div class="paragraph"><p><span class="image plain"><img src="images/in_place_relocation2.svg" alt="in place relocation2" width="600"></span></p></div>
<div class="paragraph"><p><code>-XX:+UseZGC</code></p></div></div></div>
<div class="openblock col2 small"><div class="content"><div class="paragraph"><p><em>„A scalable low-latency garbage collector“</em></p></div>
<div class="ulist"><div class="title">Ziele</div><ul><li><p>GC Pausen kleiner <span class="deleted">10ms</span> <strong>1ms</strong></p></li><li><p>Durchsatz max. -15% gegenüber G1</p></li><li><p>Heapgrößen 8MB – <strong>16TB</strong></p></li><li><p>Einfaches Tuning</p></li></ul></div>
<div class="paragraph"><p><span class="emphasize"><em>Colored Pointers & Load Barriers</em><br>
→ Object Relocation</span></p></div></div></div>
<div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://wiki.openjdk.java.net/display/zgc/Main" class="bare">https://wiki.openjdk.java.net/display/zgc/Main</a></p></div></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Aus dem Hause <em>Oracle</em>; ehemals kommerziell</p></li><li><p>JDK seit 11; Production since JDK 15; dann auch mit Linux/Win/macOS</p></li><li><p>Ziele …</p></li><li><p>Pausen unabhängig von Heap <strong>und</strong> Live- & Root-Set</p></li><li><p>Eigenschaften: Parallel, Regionen-basiert, ohne Generation, <em>Compacting</em> und <em>NUMA-aware</em></p><div class="ulist"><ul><li><p>Konzept: <em>Colored pointers</em> plus <em>Load barriers</em> → Relocation</p></li></ul></div></li><li><p>"Schwuppizität" zum Preis von CPU und Gesamtlaufzeit</p></li></ul></div></aside></div></section><section id="_shennadoah_gc" class="left"><h2>Shennadoah GC</h2><div class="slide-content"><div class="paragraph"><p><em>„A low-pause-time garbage collector by concurrent evacuation work“</em><br></p></div>
<div class="openblock col2 small"><div class="content"><div class="ulist"><ul><li><p>ZGC sehr ähnlich <em>Brooks (Forward) Pointers</em></p></li><li><p>Bietet verschieden Modi & Heuristic-Profile:
<em>adaptive, static, compact, aggressive</em></p></li><li><p>Beil zahlreichen Weak References → ZGC</p></li></ul></div></div></div>
<div class="openblock col2 small"><div class="content"><div class="ulist"><ul><li><p><strong>Red Hat</strong> Kind → andere Service Offerings</p></li><li><p><strong>Backports</strong> für JDK 8 & 11; auch <strong>32-bit</strong></p></li><li><p>ggü. ZGC: abhängig von Root- & Live-Set</p></li></ul></div>
<div class="paragraph"><p><span class="x-small"><code>-XX:+UseShenandoahGC</code></span></p></div></div></div>
<div class="paragraph center"><p><span class="image plain"><img src="images/shenandoah-gc-cycle.png" alt="shenandoah gc cycle" width="1000"></span></p></div>
<div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://wiki.openjdk.java.net/display/shenandoah" class="bare">https://wiki.openjdk.java.net/display/shenandoah</a></p></div></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Name nach US Nationalpark</p></li><li><p>von Red Hat → auch Backports & Architekturen (z.B. ARM32)</p></li><li><p>seit 2013 und seit v12 im JDK; seit JDK15 Production</p></li><li><p>Pausen steigen mit Root Set / Live Set</p></li></ul></div></aside></div></section><section id="_performance_g1_vs_zgc_vs_shenandoah" data-background-image="images/gc-performance-transparent.png" data-background-size="contain"><div class="slide-content"><aside class="notes"><div class="ulist"><ul><li><p>Arbeitsbereich ist links! Rechts = Überlast</p></li><li><p>S & Z : Vergleichbare, gegenüber G1 deutlich niederige Latenzen</p></li><li><p>Verhalten bei wachsender Last: Hier scheint ZGC irgendwann den Punkt zu erreichen wo es nicht mehr mithalten kann; bei Shenandoah früher Latenz</p></li><li><p>Man sieht klar: G1 ist Tradeoff zwischen Latenz & Durchsatz → auch bei höhere Durchsatz stabil</p></li></ul></div></aside></div></section><section id="_gc_in_der_übersicht" class="degrade"><h2>GC in der Übersicht</h2><div class="slide-content"><table class="tableblock frame-none grid-horizontal x-small" style="width:100%"><colgroup><col style="width:10%"><col style="width:20%"><col style="width:70%"></colgroup><thead><tr><th class="tableblock halign-right valign-top">GC</th><th class="tableblock halign-center valign-top">Optimiert für…</th><th class="tableblock halign-left valign-top">Kommentar</th></tr><tbody><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>G1</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Balance</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Üblicher Default. Überwiegend Nebenläufig. Zielt auf Balance von Durchsatz & Latenz. Außreißer-Pausen bis 250~800ms. Guter Durchsatz. Häppchenweise Pausen an Zeitbudget orientiert.</p></td></tr><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>Shenandoah</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Latenz</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Auch verfügbar für JDK8, JDK11 und 32-bit.</p></td></tr><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>ZGC</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Latenz</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">besser für <code>WeakRef</code>; Pausen auch unabhängig Live- und Root-Set</p></td></tr><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>ParallelGC</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Durchsatz</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Parallel & mehrere Threads. Hoher Durchsatz.<br>
Typische Pausen ~300ms abhängig von Heap-Größe.</p></td></tr><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>SerialGC</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Speicherbedarf</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Single-Threaded. Empfiehlt sich nur für Heaps ~100MB.</p></td></tr><tr><td class="tableblock halign-right valign-top"><p class="tableblock"><em>Zing/Azul</em></p></td><td class="tableblock halign-center valign-top"><p class="tableblock">Pauseless</p></td><td class="tableblock halign-left valign-top"><p class="tableblock">Nicht im OpenJDK; nur kommerziell verfügbar</p></td></tr></table></div></section><section id="_überblick_änderungen_gcs" class="degrade"><h2>Überblick Änderungen GC’s</h2><div class="slide-content"><div class="openblock col3-c x-small"><div class="content"><div class="ulist"><div class="title">ZGC</div><ul><li><p>Concurrent Class Unloading <span class="version">12</span></p></li><li><p>Uncommit Unused Memory <span class="jep"><a href="https://openjdk.java.net/jeps/351">JEP 351</a></span> <span class="version">13</span></p></li><li><p><code>-XXSoftMaxHeapSize</code> Flag <span class="version">13</span></p></li><li><p>Max. Heap Size Increased to 16TB <span class="version">13</span></p></li><li><p>ZGC on macOS <span class="jep"><a href="https://openjdk.java.net/jeps/364">JEP 364</a></span> <span class="version">14</span></p></li><li><p>ZGC on Windows <span class="jep"><a href="https://openjdk.java.net/jeps/365">JEP 365</a></span> <span class="version">14</span></p></li><li><p>ZGC Production-Ready <span class="jep"><a href="https://openjdk.java.net/jeps/377">JEP 377</a></span> <span class="version">15</span></p></li><li><p>Concurrent Stack Processing <span class="jep"><a href="https://openjdk.java.net/jeps/376">JEP 376</a></span> <span class="version">16</span></p></li></ul></div>
<div class="ulist"><div class="title">Epsilon</div><ul><li><p>Epsilon Bug TLABs extension <span class="version">14</span></p></li><li><p>Epsilon warns about Xms/Xmx/… <span class="version">14</span></p></li></ul></div></div></div>
<div class="openblock col3-l x-small"><div class="content"><div class="ulist"><div class="title">G1</div><ul><li><p><span class="step highlight-current-blue fragment">OldGen on NV-DIMM</span> <span class="version">12</span></p></li><li><p><span class="step highlight-current-blue fragment">Uncommit Memory</span> <span class="version">12</span></p></li><li><p>Improved Sparse PRT Ergonomics <span class="version">13</span></p></li><li><p>NUMA-Aware Memory Alloc. <span class="jep"><a href="https://openjdk.java.net/jeps/354">JEP 354</a></span> <span class="version">14</span></p></li><li><p>Improved Heap Region Ergonomics <span class="version">15</span></p></li><li><p>Concurrently Uncommit Memory <span class="version">16</span></p></li></ul></div>
<div class="ulist"><div class="title">Shenandoah</div><ul><li><p>Shenandoah (Experimental) <span class="jep"><a href="https://openjdk.java.net/jeps/189">JEP 189</a></span> <span class="version">12</span></p></li><li><p>Self-fixing barriers <span class="version">14</span></p></li><li><p>Async. object/region pinning <span class="version">14</span></p></li><li><p>Concurrent class unloading <span class="version">14</span></p></li><li><p>Arraycopy improvements <span class="version">14</span></p></li><li><p>Shenandoah Production-Ready <span class="jep"><a href="https://openjdk.java.net/jeps/379">JEP 379</a></span> <span class="version">15</span></p></li></ul></div></div></div>
<div class="openblock col3-r x-small"><div class="content"><div class="ulist"><div class="title">Bugfixes</div><ul><li><p>Disable large pages on Windows <span class="version">15</span></p></li><li><p>Disable NUMA Interleaving on Win.<span class="version">15</span></p></li></ul></div>
<div class="ulist"><div class="title">Legacy</div><ul><li><p><span class="step highlight-current-blue fragment">ParallelGC Improvements</span> <span class="version">14</span></p></li><li><p>Obsolete <span class="x-small"><code>-XXUseAdaptiveGCBoundary</code></span> <span class="version">15</span></p></li><li><p>Enable Parallel Ref. Processing <span class="version">17</span></p></li><li><p>SerialGC Improved young report <span class="version">13</span></p></li><li><p>ParalellOldGC: Deprecate <span class="jep"><a href="https://openjdk.java.net/jeps/366">JEP 366</a></span> <span class="version">14</span></p></li><li><p><span class="step highlight-current-blue fragment">CMS: Remove CMS GC</span> <span class="jep"><a href="https://openjdk.java.net/jeps/363">JEP 363</a></span> <span class="version">14</span></p></li></ul></div>
<div class="paragraph"><p><span class="step highlight-current-blue fragment"><span class="icon"><i class="fa fa-exclamation-triangle"></i></span> Many, many, more…</span></p></div></div></div>
<aside class="notes"><div class="olist arabic"><ol class="arabic"><li><p>Old Gen auf alternativen Memory Geräten</p></li><li><p>G1 kann wieder Speicher freigeben</p></li><li><p>Auch ParallelGC erfährt Verbesserungen</p></li><li><p>CMS wurde entfernt</p></li><li><p>→ Viel mehr; teils nicht in den Release Notes</p></li></ol></div></aside></div></section><section id="_tldr_tipps_für_den_gc"><h2>TL;DR Tipps für den GC</h2><div class="slide-content"><div class="paragraph statement tgap fragment"><p><span class="icon"><i class="fa fa-level-up-alt"></i></span> Upgrade lohnt sich!</p></div>
<div class="paragraph statement fragment"><p><span class="icon"><i class="fa fa-graduation-cap"></i></span> Probieren geht über Studieren!</p></div>
<div class="paragraph statement fragment"><p><span class="icon"><i class="fa fa-trash-alt"></i></span> Mut zum (probeweisen) Wegwerfen:<br>
Alte Tuning-Parameter</p></div>
<div class="paragraph statement fragment"><p><span class="icon"><i class="fa fa-stopwatch"></i></span> Latenz wichtig? → ZGC oder Shenandoah</p></div>
<div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://blogs.oracle.com/javamagazine/understanding-the-jdks-new-superfast-garbage-collectors" class="bare">https://blogs.oracle.com/javamagazine/understanding-the-jdks-new-superfast-garbage-collectors</a>
<a href="https://docs.oracle.com/en/java/javase/17/gctuning/available-collectors.html" class="bare">https://docs.oracle.com/en/java/javase/17/gctuning/available-collectors.html</a></p></div></div></div></div></section></section>
<section><section id="_class_data_sharing" class="lightbg" data-background-video="images/sharing-pizza.mp4" data-background-video-loop data-background-video-muted data-background-opacity="1"><h2>Class Data Sharing</h2></section><section id="_class_data_sharing_in_a_nutshell"><h2>Class Data-Sharing in a Nutshell</h2><div class="slide-content"><div class="dlist"><dl><dt class="hdlist1">Class Data-Sharing</dt><dd><p>Reduziert Startzeiten & Speicherbedarf neuer JVMs
durch <code>.jsa</code> Archiv mit Metadaten der Klassen.</p><div class="paragraph"><p>→ Klassen liegen vorgeparsed <em>direkt für die JVM verwendbar</em> vor. Das Archiv kann <em>read-only</em> eingebunden werden, was dem OS <em>Caching</em> & <em>Sharing</em> erlaubt.</p></div>
<div class="paragraph"><p><strong>Achtung:</strong> Archive sind JVM Plattform- und Versionspezifisch!</p></div></dd></dl></div>
<div class="dlist fragment left"><dl><dt class="hdlist1">Application Class-Data Sharing (AppCDS)</dt><dd><p>Erlaubt zusätzlich Applikations-Klassen in das CDS aufzunehmen.</p></dd></dl></div></div></section><section id="_neuerungen_im_bereich_cds"><h2>Neuerungen im Bereich CDS</h2><div class="slide-content"><div class="dlist fragment tgap"><dl><dt class="hdlist1">Default CDS Archive <span class="version">12</span> <span class="jep"><a href="https://openjdk.java.net/jeps/341">JEP 341</a></span></dt><dd><p>JVM liefert nun per Default ein <code>classes.jsa</code> CDS-Archiv mit aus, welches ein Subset der häufigsten JDK-Klassen umfasst.</p></dd></dl></div>
<div class="dlist fragment tgap"><dl><dt class="hdlist1">Dynamic CDS Archive <span class="version">13</span> <span class="jep"><a href="https://openjdk.java.net/jeps/350">JEP 350</a></span></dt><dd><p>Vereinfacht erheblich die Erstellung eigener AppCDS Archive durch automatische Auswahl und Archiverzeugung beim beenden der Java-Applikation.</p></dd></dl></div></div></section><section id="_appcds_archiverstellung"><h2>AppCDS Archiverstellung</h2><div class="slide-content"><div class="listingblock compact"><div class="title">Bisher: Erstellung über Liste <span class="version">11</span></div><div class="content"><pre class="highlightjs highlight"><code class="language-shell hljs" data-noescape="true" data-lang="shell">$ java -Xshare:off -XX:DumpLoadedClassList=myclasses.txt -cp myapp.jar MyApp
$ java -Xshare:dump -XX:SharedArchiveFile=myapp.jsa \
-XX:SharedClassListFile=myclasses.txt -cp myapp.jar</code></pre></div></div>
<div class="listingblock fragment compact"><div class="title">NEU: Automatische Erstellung <span class="version">13</span></div><div class="content"><pre class="highlightjs highlight"><code class="language-shell hljs" data-noescape="true" data-lang="shell">$ java -XX:ArchiveClassesAtExit=myapp.jsa -cp myapp.jar MyApp</code></pre></div></div>
<div class="listingblock fragment compact"><div class="title">Nutzung des AppCDS-Archives</div><div class="content"><pre class="highlightjs highlight"><code class="language-shell hljs" data-noescape="true" data-lang="shell">$ java -XX:SharedArchiveFile=myapp.jsa -cp myapp.jar MyApp</code></pre></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Bedenken: Nur die Klassen die die JVM während des Lauf lädt.</p></li></ul></div></aside></div></section><section id="_appcds_gewinne"><div class="slide-content"><div class="imageblock"><img src="images/app_cds_time_to_first_response.png" alt="AppCDS Startup Times" height="700"></div>
<div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://www.morling.dev/blog/building-class-data-sharing-archives-with-apache-maven/" class="bare">https://www.morling.dev/blog/building-class-data-sharing-archives-with-apache-maven/</a></p></div></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>→ Gunnar Morling</p></li><li><p>Teils bis zu 40% Reduktion in Startup-Times</p></li></ul></div></aside></div></section><section id="_appcds_kombiniert_mit_jlink" class="degrade"><div class="slide-content"><div class="paragraph"><div class="title">AppCDS kombiniert mit <code>jlink</code></div><p> </p></div>
<div class="imageblock"><img src="images/jlink_app_cds_image_size_and_startup_times.png" alt="AppCDS Startup Times" height="640"></div>
<aside class="notes"><div class="ulist"><ul><li><p>Noch mehr Potential mit Kombination von <code>jlink</code></p><div class="ulist"><ul><li><p>Wir erinnern uns: <code>jlink</code> Erlaubt die Auswahl einer Teilmenge von Modules für ein custom runtime images</p></li><li><p>Nur benötigte Module → weniger Klassen/Balast</p></li></ul></div></li><li><p>Ergebnis</p><div class="olist arabic"><ol class="arabic"><li><p>Kleinere Images</p></li><li><p>Mit AppCD deutlich schneller: 1,8s → 0,8s</p></li></ol></div></li><li><p>Nachteil: Komplexität des Gesamtbuilds</p></li></ul></div></aside></div></section></section>
<section><section id="_jdk_flight_recorder_jfr" class="lightbg forcebottom" data-background-video="images/flight-cockpit.mp4" data-background-video-loop data-background-video-muted data-background-opacity="1"><h2>JDK Flight Recorder (JFR)</h2><div class="slide-content"><aside class="notes"><div class="paragraph"><p>Kommen wir zu "mehr Druchblick" mit JavaFR & JMC</p></div></aside></div></section><section id="_jdk_flight_recorder_jfr_jep_328" class="degrade"><h2>JDK Flight Recorder (JFR) <span class="jep"><a href="https://openjdk.java.net/jeps/328">JEP 328</a></span></h2><div class="slide-content"><div class="ulist"><ul><li><p>OS, JVM, JDK & App Diagnostik</p></li><li><p>extrem geringer Overhead (~1%)</p></li><li><p>built-in & jederzeit aktivierbar</p></li><li><p>always-on möglich → Timemachine</p></li></ul></div>
<div class="paragraph"><p>→ <span class="step highlight-current-blue fragment"><span class="icon"><i class="fa fa-cogs"></i></span> <strong>Production</strong> Profiling & Monitoring</span></p></div>
<aside class="notes"><div class="ulist"><ul><li><p>Ehemals kommerzielles JVM Addon "Java Flight Recorder"</p></li><li><p>seit Java 11 OpenJDK Bestandteil</p></li><li><p>Aktivierbar für neue und <strong>bereits laufende</strong> Java-Instanzen</p></li><li><p>Zielmetrik: Weniger als 1% Overhead → no measurable impact on the running application → klare Ausrichtung für Produktionsverwendung</p></li><li><p>Built by the JVM/JDK people</p><div class="ulist"><ul><li><p>→ access to data already collected, more accurate, faster</p></li><li><p>Safe and reliable in production</p></li></ul></div></li><li><p>always on → Time machine – just dump the recording data when a problem occurs, and see what the runtime was up to before, up to, and right after the problem occurred.</p></li><li><p>Even on JVM crash → JFR data avail in dump</p></li></ul></div>
<div class="paragraph"><p>JDK Mission Control also contains other tools, such as a JMX Console, and HPROF-dump analyzer and more.</p></div></aside></div></section><section id="_jfr_demo"><div class="slide-content"><div class="openblock col3-lc"><div class="content"><div class="videoblock"><video src="images/jfr.mp4" width="100%" height="720" poster="images/jfr-screen.png">Your browser does not support the video tag.</video></div></div></div>
<div class="openblock col3-r left small"><div class="content"><div class="paragraph"><p><strong>Flight Recorder Demo</strong></p></div>
<div class="literalblock"><div class="title">Prozess identifizieren</div><div class="content"><pre>jcmd</pre></div></div>
<div class="literalblock"><div class="title">Recording</div><div class="content"><pre>jcmd <pid> JFR.start
jcmd <pid> JFR.dump \
filename=record.jfr</pre></div></div>
<div class="paragraph xx-small decent"><p>Optionen: <code>filename</code>, <code>delay</code>, <code>dumponexit</code>, <code>duration</code>, <code>maxage</code>, <code>maxsize</code>, …</p></div>
<div class="literalblock"><div class="title">Analysieren</div><div class="content"><pre>jfr print record.jfr
jfr print \
--events CPULoad \
--json record.jfr
jfr summary record.jfr</pre></div></div></div></div>
<aside class="notes"><div class="olist arabic"><ol class="arabic"><li><p>PID identifizieren</p></li><li><p>JFR starten (& konfigurieren)</p></li><li><p>Optionen → bei Crash, delay, laufzeit, Ringbuffer-Parameter</p></li><li><p>Events sichten</p><div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Filter nach Event & Kategorie</p></li><li><p>→ Export JSON mgl</p></li><li><p>Grobe Summe</p></li></ol></div></li></ol></div>
<div class="paragraph"><p>Grobe Orientierung ohne ext. mittel; für mehr Einsichten brauchts aber Tools.</p></div></aside></div></section><section id="_jdk_mission_control_jmc" data-background-size="contain" data-background-video="images/jmc.mp4"><div class="slide-content"><div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://openjdk.java.net/projects/jmc/8/" class="bare">https://openjdk.java.net/projects/jmc/8/</a></p></div></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Ex-Payware "Java F…"; seit v11 Open "JDK F…"</p></li><li><p>8.1+ für JFR Events von JDK17 (Heap)</p></li><li><p>JMX Live Status / Properties</p></li><li><p>Hilfreich: Automatisierte Alert bei Grenzwerte</p></li><li><p>Aber auch: JFR dumps laden bzw. live tracen</p></li><li><p>Erlaubt grobe Kategorieeinstellung</p></li><li><p>… und per einzelnem JFR Event</p></li></ul></div></aside></div></section><section id="_jfr_event_streaming_jep_349_14_16"><h2>JFR Event Streaming <span class="jep"><a href="https://openjdk.java.net/jeps/349">JEP 349</a></span> <span class="version">14</span> <span class="version">16</span></h2></section><section id="_jdk11" data-transition="none" data-background-color="white" data-background-image="images/jfrstreaming0.png" data-background-size="contain"><div class="slide-content"><aside class="notes"><div class="ulist"><ul><li><p>Vor JDK14: Start JFR → Dump (File/JMX) → Analyze.</p></li><li><p><strong>Gut für Profiling, schlecht für Continuous Monitoring</strong></p></li></ul></div></aside></div></section><section id="_jdk14" data-transition="none" data-background-color="white" data-background-image="images/jfrstreaming1.png" data-background-size="contain"><div class="slide-content"><aside class="notes"><div class="ulist"><ul><li><p>Mit Java 14: JFR Event Streaming:</p></li><li><p>API anbieten um (kontinuierlich) Events des JFR Disk Repo lesen zu können</p></li><li><p>Ziel: <strong>Trivial kontinuierlich JFR Events monitoren</strong> und darauf <strong>reagieren können</strong></p></li></ul></div></aside></div></section><section id="_jdk16" data-transition="none" data-background-color="white" data-background-image="images/jfrstreaming2.png" data-background-size="contain"><div class="slide-content"><aside class="notes"><div class="ulist"><ul><li><p>Neu in JDK 16:</p><div class="ulist"><ul><li><p>Erlaubt auch <strong>Remote Streaming</strong></p></li><li><p>Neues, leichtgewichtiges <code>jdk.ObjectAllocationSample</code> <strong>default on</strong></p></li></ul></div></li><li><p>GraalVM ab 21.2 unterstützt ebenfalls JFR</p></li></ul></div></aside></div></section><section id="_jfr_event_streaming_api_beispiel"><h2>JFR Event Streaming API: Beispiel</h2><div class="slide-content"><div class="paragraph"><p>Reported sekündlich CPU Usage und aktive Locks länger als 10ms:</p></div>
<div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">try (var rs = new RecordingStream()) {
rs.enable("jdk.CPULoad").withPeriod(Duration.ofSeconds(1));
rs.enable("jdk.JavaMonitorEnter").withThreshold(Duration.ofMillis(10));
rs.onEvent("jdk.CPULoad", event -> {
System.out.println(event.getFloat("machineTotal"));
});
rs.onEvent("jdk.JavaMonitorEnter", event -> {
System.out.println(event.getClass("monitorClass"));
});
rs.start(); // Blockierender Aufruf, bis Stream endet/geschlossen wird
// rs.startAsync(); Alternative im separaten Thread
}</code></pre></div></div>
<div class="openblock refs"><div class="content"><div class="paragraph"><p>JFR Eventtypen: <a href="https://bestsolution-at.github.io/jfr-doc/" class="bare">https://bestsolution-at.github.io/jfr-doc/</a></p></div></div></div></div></section><section id="_zugriffsmöglichkeiten" class="small degrade"><h2>Zugriffsmöglichkeiten</h2><div class="slide-content"><div class="listingblock col2"><div class="title">Passiv, eigener Prozess</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">EventStream.openRepository()) {…}</code></pre></div></div>
<div class="listingblock col2"><div class="title">Passiv, fremder Prozess</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">EventStream.openRepository(Path.of("…")))</code></pre></div></div>
<div class="listingblock"><div class="title">Aktiv, eigener Prozess</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">try (var stream = new RecordingStream()) { … }</code></pre></div></div>
<div class="listingblock"><div class="title">Aktiv, fremder Prozess (Remote)</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">String url = "service:jmx:rmi:///jndi/rmi://myhost.de:7091/jmxrmi";
JMXConnector c = JMXConnectorFactory.connect(new JMXServiceURL(url));
MBeanServerConnection conn = c.getMBeanServerConnection();
try (RemoteRecordingStream stream = new RemoteRecordingStream(conn)) { … }</code></pre></div></div></div></section><section id="_eigene_jfr_events" class="small degrade"><h2>Eigene JFR Events</h2><div class="slide-content"><div class="openblock col2"><div class="content"><div class="listingblock"><div class="title">Event definieren</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">import jdk.jfr.*;
@Name("de.bentolor.ButtonPressed")
@Label("Button Pressed")
@StackTrace(false)
public class ButtonEvent extends Event {
@Label("Button name")
public String name;
@Label("Source")
public String trigger;
@Label("Number of Bounces")
@DataAmount
public int bounces;
@Label("Has timeouted")
public boolean timeouted;
}</code></pre></div></div></div></div>
<div class="openblock col2 fragment"><div class="content"><div class="listingblock"><div class="title">Event füttern & auslösen</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">ButtonEvent evt = new ButtonEvent();
if(evt.isEnabled()) {
evt.name = "Button 1";
evt.trigger = "Keyboard";
evt.begin();
}
// doSomething()
if(evt.isEnabled()) {
evt.end();
evt.timeouted = false;
evt.bounces = 3;
evt.commit();
}</code></pre></div></div></div></div></div></section><section id="_weitere_anwendungsfälle" class="degrade"><h2>Weitere Anwendungsfälle</h2><div class="slide-content"><div class="dlist small col2"><dl><dt class="hdlist1">Unit- & Performance-Testing</dt><dd><p>Annahmen zum Verhalten von API, JVM & Co. in Testcases sichern.<br>
<br>
<span class="decent">Unterstützende Frameworks z.B. <a href="https://github.com/moditect/jfrunit">JfrUnit</a> oder <a href="https://github.com/quick-perf/quickperf">QuickPerf</a></span></p></dd></dl></div>
<div class="dlist small col2"><dl><dt class="hdlist1">Timeshift-Analyse</dt><dd><p>Recording mitlaufen lassen und bei Performance-Problemen rückwirkend seit Problemstartpunkt aus dem JFR Event Repository extrahieren & analysieren (<em>„Timeshift“</em>)</p></dd></dl></div></div></section></section>
<section><section id="_foreign_function_memory_api_incubator" class="lightbg forcetop" data-background-video="images/pexels-cottonbro-7319201.mp4" data-background-video-loop data-background-video-muted data-background-opacity="1"><h2>Foreign Function & Memory API <span class="preview">Incubator</span></h2></section><section id="_exkurs_preview_features_preview_jep_12" class="degrade"><h2>Exkurs: Preview features <span class="preview">Preview</span> <span class="jep"><a href="https://openjdk.java.net/jeps/12">JEP 12</a></span></h2><div class="slide-content"><div class="paragraph"><p>Auslieferung experimenteller Sprach- und JVM-Features,<br>
oft in Iterationen, zur Förderung von frühem Community Feedback.<br>
<span class="decent x-small"><em>z.B.: Pattern Matching, Switch Expression, Text Blocks, Records, Sealed Classes</em></span></p></div>
<div class="openblock col2"><div class="content"><div class="listingblock"><div class="title">Unlock Compilation</div><div class="content"><pre class="highlightjs highlight"><code class="language-bash hljs" data-noescape="true" data-lang="bash">javac --enable-preview …</code></pre></div></div></div></div>
<div class="openblock col2"><div class="content"><div class="listingblock"><div class="title">Unlock Execution</div><div class="content"><pre class="highlightjs highlight"><code class="language-bash hljs" data-noescape="true" data-lang="bash">java --enable-preview …</code></pre></div></div></div></div>
<div class="openblock clear"><div class="content"><div class="paragraph"><p> <br>
<span class="decent small">Keine Cross-compilation mittels <code>--release xx</code> möglich!</span></p></div></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Forces awareness by using toggle switch on <em>compiling and running</em></p></li><li><p>Typisch mehrere Iterationen (z.B. <code>switch</code>-Statement)</p></li><li><p>Stabilisierung auf LTS; in 17 LTS daher kein Preview Feature</p></li></ul></div></aside></div></section><section id="_exkurs_incubator_modules_incubator_jep_11" class="degrade"><h2>Exkurs: Incubator Modules <span class="preview">Incubator</span> <span class="jep"><a href="https://openjdk.java.net/jeps/11">JEP 11</a></span></h2><div class="slide-content"><div class="paragraph"><p>Analog <em>Preview Features</em> für nicht-finale APIs und Tools<br></p></div>
<div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-bash hljs" data-noescape="true" data-lang="bash">javac --add-modules jdk.incubator.foo …
java --add-modules jdk.incubator.foo …</code></pre></div></div>
<div class="paragraph"><p><span class="decent x-small"><em>z.B.: HTTP/2 Client, Packaging Tool, …</em></span></p></div>
<aside class="notes"><div class="paragraph"><p>Interessanterweise 2 "Incubator" in der LTS Version: <em>"Vector API"</em> und <em>"Foreign Function & Memory API"</em></p></div></aside></div></section><section id="_retro_java_native_interface_jni" class="degrade"><h2>Retro: Java Native Interface (JNI)</h2><div class="slide-content"><div class="imageblock plain" style="float: left"><img src="images/jni-process.png" alt="Java Native Interface Process" width="1000"></div>
<div class="openblock small"><div class="content"><div class="ulist"><ul><li><p>26 Jahre alt</p></li><li><p>erfordert <code>.c</code> & <code>.h</code>-Files</p></li><li><p>mehrstufiger Prozess:<br>
kleinteilig & brüchig</p></li></ul></div>
<div class="paragraph"><p>↓</p></div>
<div class="paragraph"><p>sehr verworren</p></div></div></div>
<aside class="notes"><div class="paragraph"><p>bildquelle: <a href="https://developers.redhat.com/blog/2016/11/03/eclipse-for-jni-development-and-debugging-on-linux-java-and-c#general_overview_of_jni_compilation_and_the_eclipse_project" class="bare">https://developers.redhat.com/blog/2016/11/03/eclipse-for-jni-development-and-debugging-on-linux-java-and-c#general_overview_of_jni_compilation_and_the_eclipse_project</a></p></div></aside></div></section><section id="_motivation_project_panama_incubator_jep_412"><h2>Motivation Project Panama <span class="preview">Incubator</span> <span class="jep"><a href="https://openjdk.java.net/jeps/412">JEP 412</a></span></h2><div class="slide-content"><div class="paragraph"><p>Starke Drittbibliotheken (z.B. ML/AI) mit dynamischer Entwicklung<br>
<span class="decent"><em>Tensorflow</em>, <em>OpenSSL</em>, <em>libodium</em>, …</span></p></div>
<div class="quoteblock x-small fragment tgap"><blockquote><div class="paragraph"><p>Introduce an API by which Java programs can interoperate with code and
data outside of the Java runtime […] without the brittleness and danger of JNI.</p></div></blockquote></div>
<div class="paragraph fragment tgap"><p><strong>Ziele:</strong> <em>Einfachheit – Performance – Sicherheit</em></p></div>
<aside class="notes"><div class="ulist"><ul><li><p>Motivation: ML → Python Ecosystem → vs. re-implementing</p></li></ul></div>
<div class="ulist"><div class="title">Ziele</div><ul><li><p>Einfachheit → nur Java</p></li><li><p>→ hofft auf Tooling</p></li><li><p>Performance: Vergleichbar mit JNI</p></li><li><p>Umschiffen alter Scrhanken wie max 2GB mit ByteBuffer max. 2GB und foreign Memory GC-manages.</p></li><li><p>Sicherheit: Abkommen von <code>sun.misc.Unsafe</code>;</p></li></ul></div>
<div class="ulist"><div class="title">Historie:</div><ul><li><p>Zwei JEPs / APIs: Memory Access API & Foreign Linker API</p></li><li><p>erstmals JDK14, dann 15, 16 und nun zusammengeführt in 17</p></li></ul></div></aside></div></section><section id="_einfacher_funktionsaufruf" class="degrade"><h2>Einfacher Funktionsaufruf</h2><div class="slide-content"><div class="listingblock small"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">import java.lang.invoke.*;
import jdk.incubator.foreign.*;
class CallPid {
public static void main(String... p) throws Throwable {
var libSymbol = CLinker.systemLookup().lookup("getpid").get(); <i class="conum" data-value="1"></i><b>(1)</b>
var javaSig = MethodType.methodType(long.class); <i class="conum" data-value="2"></i><b>(2)</b>
var nativeSig = FunctionDescriptor.of(CLinker.C_LONG); <i class="conum" data-value="3"></i><b>(3)</b>
CLinker cABI = CLinker.getInstance();
var getpid = cABI.downcallHandle(libSymbol, javaSig, nativeSig); <i class="conum" data-value="4"></i><b>(4)</b>
System.out.println((long) getpid.invokeExact()); <i class="conum" data-value="5"></i><b>(5)</b>
}
}</code></pre></div></div>
<div class="colist arabic"><table><tr><td><i class="conum" data-value="1"></i><b>1</b></td><td>adressiertes <em>Symbol</em> – hier via Lookup in den System Libraries</td></tr><tr><td><i class="conum" data-value="2"></i><b>2</b></td><td>gewünschte <em>Java-Signatur</em> des Java Foreign Handles</td></tr><tr><td><i class="conum" data-value="3"></i><b>3</b></td><td><em>Ziel-Signatur</em> der aufzurufenden C-Funktion</td></tr><tr><td><i class="conum" data-value="4"></i><b>4</b></td><td>Funktionshandle beziehen</td></tr></table></div></div></section><section id="_aufruf_mit_pointer_12" class="degrade"><h2>Aufruf mit Pointer (1/2)</h2><div class="slide-content"><div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-c hljs" data-noescape="true" data-lang="c">int crypto_box_seal(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *pk)</code></pre></div></div>
<div class="paragraph"><p><span class="decent xx-small">…liest Text aus <code>*m</code>, Zielschlüssel <code>*pk</code> und schreibt
verschlüsseltes Ergebnis in nativen Speicher <code>*c</code></span><br>
↓</p></div>
<div class="listingblock fragment"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">var cryptoBoxSeal = CLinker.getInstance().downcallHandle(
SymbolLookup.loaderLookup().lookup("crypto_box_seal").get(),
MethodType.methodType(int.class,
MemoryAddress.class, MemoryAddress.class,
long.class, MemoryAddress.class),
FunctionDescriptor.of(C_INT,
C_POINTER, C_POINTER,
C_LONG_LONG, C_POINTER) );</code></pre></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>libsodium Funktion</p></li><li><p>erwartet drei Pointer</p><div class="ulist"><ul><li><p>java: <code>MemoryAddress</code></p></li><li><p>C: <code>C_POINTER</code></p></li></ul></div></li></ul></div></aside></div></section><section id="_aufruf_mit_pointer_22" class="small degrade"><h2>Aufruf mit Pointer (2/2)</h2><div class="slide-content"><div class="listingblock"><div class="title">Foreign Heap wird vom GC via <code>ResourceScope</code> verwaltet</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">try (var scope = ResourceScope.newConfinedScope()) { … }</code></pre></div></div>
<div class="listingblock fragment"><div class="title">String-Konvertierung & Kopie in nativen Heap</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">var plainMsg = CLinker.toCString("abc", scope);</code></pre></div></div>
<div class="listingblock fragment"><div class="title">Reservierung Ziel-Speicherbereich</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">var cipherText = scope.allocate(48 + plainMsg.byteSize(), scope);
var pubKey = scope.allocateArray(C_CHAR, publicKey);</code></pre></div></div>
<div class="listingblock fragment"><div class="title">Aufruf & Rückgabe</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">var ret = (int) cryptoBoxSeal.invokeExact( cipherText.address(), plainMsg.address(),
(long) plainMsg.byteSize(), pubKey.address());
return cipherText.toByteArray();</code></pre></div></div>
<aside class="notes"><div class="paragraph"><p>die Frage: Wie mit Java nativen Speicher bekommen?</p></div>
<div class="olist arabic"><ol class="arabic"><li><p>Foreign Memory → managed by GC</p></li><li><p>dazu an separates <code>ResourceScope</code>-Objekt gebunden</p></li></ol></div></aside></div></section><section id="_helferlein_jextract"><h2>Helferlein <code>jextract</code></h2><div class="slide-content"><div class="paragraph"><p>Generiert aus direkt aus <code>.h</code>-Dateien passende API Wrapper<br>
als <code>.class</code> oder <code>.java</code> mit den notwendigen Foreign API-Aufrufen.<br>
<span class="decent xx-small">Nicht direkt in JDK 17 enthalten, sondern via Panama EAP JDK Builds (siehe Link).</span></p></div>
<div class="listingblock fragment"><div class="content"><pre class="highlightjs highlight"><code class="language-shell hljs" data-noescape="true" data-lang="shell">$ jextract -t de.bentolor /usr/include/unistd.h</code></pre></div></div>
<div class="listingblock fragment"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">import de.bentolor.unistd_h;
class CallPid {
public static void main(String[] args) {
System.out.println( unistd_h.getpid() );
}
}</code></pre></div></div>
<aside class="notes"><div class="ulist"><ul><li><p>Nicht Teil des JDK, separater Download</p></li><li><p>Erzeugt / Generiert den Boiler Code</p></li><li><p>Da große 89MB <em>LLVM</em> Dependency, vermutlich nie JDK Bestandteil</p></li></ul></div></aside>
<div class="openblock refs"><div class="content"><div class="paragraph"><p><a href="https://jdk.java.net/panama/">Project Panama Early-Access Builds</a></p></div></div></div></div></section><section id="_jextract_demo" data-background-color="white" data-background-size="contain" data-background-video="images/native-python.mp4"></section><section id="_jextract_demo_transcript"><h2><code>jextract</code> Demo (Transcript)</h2><div class="slide-content"><div class="listingblock col2 x-small"><div class="content"><pre class="highlightjs highlight"><code class="language-bash hljs" data-noescape="true" data-lang="bash">mkdir hello-python
cd hello-python
locate Python.h
jextract -t de.bentolor \
-l python3.8 \
-I /usr/include/python3.8/ \
-I /usr/include/ \
/usr/include/python3.8/Python.h
joe Schlange.java
java --add-modules jdk.incubator.foreign \
--enable-native-access=ALL-UNNAMED \
-Djava.library.path=/usr/lib/x86_64-linux-gnu/ \
Schlange.java
jextract -t de.bentolor \
-l python3.8 \
-I /usr/include/python3.8/ \
-I /usr/include/ \
--source
/usr/include/python3.8/Python.h
bat de/bentolor/Python_h.java
bat de/bentolor/Python_h_4.java
/s int PyRun_S</code></pre></div></div>
<div class="listingblock col2 x-small"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">import jdk.incubator.foreign.*;
import de.bentolor.Python_h;
public class Schlange {
public static void main(String[] args) {
String script = """
print(sum([33, 55, 66]));
print('Hello Python 3!')
""";
Python_h.Py_Initialize();
try (var scope = ResourceScope.newConfinedScope()) {
var str = CLinker.toCString(script, scope);
Python_h.PyRun_SimpleStringFlags(
str, MemoryAddress.NULL);
Python_h.Py_Finalize();
}
}
}</code></pre></div></div></div></section><section id="_jextract_verwendungsbeispiele"><div class="slide-content"><div class="imageblock"><img src="images/jextract-examples.png" alt="https://github.com/sundararajana/panama-jextract-samples" height="640"></div>
<div class="paragraph"><p><a href="https://github.com/sundararajana/panama-jextract-samples" class="bare">https://github.com/sundararajana/panama-jextract-samples</a></p></div></div></section></section>
<section><section id="_tooling" class="lightbg" data-background-video="images/hammer.mp4" data-background-video-loop data-background-opacity="0.8"><h2>Tooling</h2></section><section id="_jpackage_jep_343_jep_392"><h2><code>jpackage</code> <span class="jep"><a href="https://openjdk.java.net/jeps/343">JEP 343</a></span> <span class="jep"><a href="https://openjdk.java.net/jeps/392">JEP 392</a></span></h2><div class="slide-content"><div class="paragraph"><p>Werkzeug zum Erstellen & Paketieren eigenständiger Java-Applikationen</p></div>
<div class="openblock col2"><div class="content"><div class="paragraph"><div class="title"><span class="icon"><i class="fa fa-box-open"></i></span> Native Installer</div><p><span class="icon"><i class="fa fa-windows"></i></span> → <code>.msi</code> und <code>.exe</code><br>
<span class="icon"><i class="fa fa-apple"></i></span> → <code>.pkg</code> und <code>.dmg</code><br>
<span class="icon"><i class="fa fa-linux"></i></span> → <code>.deb</code> und <code>.rpm</code><br></p></div></div></div>
<div class="openblock col2"><div class="content"><div class="paragraph"><div class="title"><span class="icon"><i class="fa fa-sliders-h"></i></span> Konfiguration</div><p>Start-Optionen (JVM/App)<br>
Meta-Daten<br>
Datei-Assoziationen<br></p></div></div></div>
<div class="paragraph"><div class="title"><span class="icon"><i class="fa fa-ban"></i></span> Nicht im Scope</div><p>Splash-Screen<br>
Auto-Update Mechanismus</p></div>
<aside class="notes"><div class="ulist"><ul><li><p>Preview mit JDK14, stabilisiert mit JDK16</p></li><li><p>Native Installerformate für natürliche Installations UX</p></li></ul></div></aside></div></section><section id="_installation_packages_with_jpackager_jep_343_jep_392" data-background-color="black" data-background-size="contain" data-background-video="images/jpackagerfast.mp4"></section><section id="_javadoc"><h2><code>javadoc</code></h2><div class="slide-content"><div class="paragraph"><p>Das Javadoc-Tool hat mit JDK16 umfassende Verbesserungen erfahren…</p></div>
<div class="ulist col2s small lgap"><ul><li><p><strong>Verbesserte Suche</strong></p></li><li><p><strong>Fehler zeigen Code-Ausschnitt</strong></p></li><li><p>Neues/Verbessertes <em>New</em>,
<em>Deprecated</em>, <em>Related Package</em></p></li><li><p><span class="decent">Mobile-friendly Layout</span></p></li><li><p><span class="decent">autom. Links zur JDK API</span></p></li><li><p><span class="decent">Checks für leere Absätze</span></p></li><li><p><span class="decent">Bessere "Typ"-Terminologie</span></p></li><li><p><span class="decent">Bessere Darstellung von <code>@see</code>, Paketen, Nested Class, u.a.</span></p></li></ul></div>
<div class="openblock col2 small fragment"><div class="content"><div class="listingblock small"><div class="title"><code>{@return …}</code>-Shortcut</div><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">/** {@return The max value in the array} */
public static int max(final int... array) {</code></pre></div></div>
<div class="paragraph fragment"><p>↓<br>
<span class="image plain"><img src="images/return.png" alt="Javadoc Result"></span></p></div></div></div></div></section><section id="_javadoc_demo" data-background-size="contain" data-background-video="images/javadoc.mp4"></section></section>
<section><section id="_details_maintenance" class="lightbg" data-background-video="images/pexels-pavel-danilyuk-6158064.mp4" data-background-video-loop data-background-video-muted data-background-opacity="0.7"><h2>Details & Maintenance</h2></section><section id="_hilfreiche_nullpointers_jep_358_14" class="degrade"><h2>Hilfreiche Nullpointers <span class="jep"><a href="https://openjdk.java.net/jeps/358">JEP 358</a></span> <span class="version">14</span></h2><div class="slide-content"><div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-java hljs" data-noescape="true" data-lang="java">class MyClass {
record Person(String name, String email) {}
public static void main(String[] args) {
var p = new Person("Peter", null); <i class="conum" data-value="1"></i><b>(1)</b>
var e = p.email().toLowerCase();
}
}</code></pre></div></div>
<div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-text hljs" data-noescape="true" data-lang="text">$ java MyClass.java
Exception in thread "main" java.lang.NullPointerException: Cannot invoke <mark>"String.toLowerCase()</mark> because the return value of <mark>"MyClass$Person.email()" is null</mark>
at MyClass.main(MyClass.java:5)</code></pre></div></div>
<div class="colist arabic"><table><tr><td><i class="conum" data-value="1"></i><b>1</b></td><td>Für Namen von <span class="step highlight-current-blue fragment"><em>lokalen Variablen</em> und <em>Lambdas</em> mit <code>-g:vars</code> compilieren!</span></td></tr></table></div>
<aside class="notes"><div class="ulist"><ul><li><p>Erforderte früher <code>-XX:+ShowCodeDetailsInExceptionMessages</code>, nun default!</p></li></ul></div></aside></div></section><section id="_jahresinspektion" class="small degrade"><h2>„Jahresinspektion“</h2><div class="slide-content"><div class="ulist"><ul><li><p><strong>Strongly Encapsulate JDK Internals</strong> <span class="jep"><a href="https://openjdk.java.net/jeps/391">JEP 391</a></span></p></li><li><p><strong>macOS/AArch64 Port</strong> <span class="jep"><a href="https://openjdk.java.net/jeps/391">JEP 391</a></span></p></li><li><p>SecurityManager <code>forRemoval</code> <span class="jep"><a href="https://openjdk.java.net/jeps/411">JEP 411</a></span></p></li><li><p>Always-Strict Floating-Point Semantics <span class="jep"><a href="https://openjdk.java.net/jeps/306">JEP 306</a></span></p></li><li><p><strong>Asynchrones <em>Unified JVM Logging</em></strong> (<code>-Xlog:async</code>)</p></li><li><p>Ausführlichere Crashs: <code>-XX:+ExtensiveErrorReports</code></p></li><li><p>Unicode 10 → 13; CLDR 33 → 39</p></li><li><p>Krypto: Deprecated Ciphers/Signatures, Enhanced PRNG <span class="jep"><a href="https://openjdk.java.net/jeps/356">JEP 356</a></span></p></li></ul></div>
<aside class="notes"><div class="ulist"><ul><li><p>Mit JDK17 <code>--illegal-access</code> nicht mehr möglich</p><div class="ulist"><ul><li><p>Motivation: Jigsaw</p></li><li><p>Aber: sun.misc.Unsafe will remain available.</p></li><li><p>Ziel: Druck weiter erhöhen</p></li></ul></div></li><li><p><code>-XX:+ExtensiveErrorReports</code> → ausführlichere Crash-<code>hs_err….log</code></p></li><li><p>StrictFPS: Revert JDK 1.2 Change für x87 Coprozessoren</p></li><li><p>Porting the JDK to MacOS/AArch64 → Apple M1.</p></li><li><p>PRNG: Neue Impl. supporten</p></li></ul></div></aside></div></section></section>
<section><section id="_graalvm" class="lightbg" data-background-video="images/pexels-koolshooters-6909829.mp4" data-background-video-loop data-background-video-muted data-background-opacity="1"><h2>GraalVM</h2></section><section id="_project_metropolis" data-background-image="images/graalvm-architecture.png" data-background-size="contain"><div class="slide-content"><aside class="notes"><div class="ulist"><ul><li><p>Polyglot VM</p></li><li><p>In Java geschrieben VM die auf div. Sprachen zielt</p></li><li><p>gemeinnsame Runtime → multiple language with zero overhead</p></li><li><p>Kann mit LLVM native images produzieren</p></li></ul></div></aside></div></section><section id="_graalvmpolyglot_vm" class="left"><h2>GraalVM — Polyglot VM</h2><div class="slide-content"><div class="openblock col2"><div class="content"><div class="ulist"><ul><li><p><strong>Ahead-of Time compiler</strong> <span class="verydecent">(AoT)</span></p></li><li><p>Polyglotte VM für <em>div. Sprachen</em><br>
→ <strong>JVM</strong> <span class="decent">(Java, Kotlin, Scala, …)</span><br>
→ <strong>LLVM</strong> <span class="decent">(C, C++) → native</span><br>
→ <strong>Java</strong> <span class="decent">Script, Python, Ruby, R</span></p></li></ul></div></div></div>
<div class="openblock col2"><div class="content"><div class="ulist"><ul><li><p>Sprachen <strong>sharen Runtime</strong><br>
<span class="decent">→ Zero Interop Overhead</span></p></li><li><p><strong>Native executables</strong> <em>(SubstrateVM</em>)<br>
<span class="decent">→ Kleiner Startup & Memory</span></p></li><li><p><span class="decent">GraalVM Community & Enterprise</span><br>
<br>
</p></li></ul></div></div></div>
<div class="openblock clear tgap fragment"><div class="content"><div class="paragraph"><div class="title">Microservice Frameworks</div><p><em>Helidon, Quarkus.io, Micronaut, Spring Fu, Ktor, …</em><br>
<span class="verydecent x-small">→ zielen auf GraalVM AoT & Microservices, z.B. via IoC zur Compiletime</span></p></div></div></div>
<aside class="notes"><div class="olist arabic"><ol class="arabic"><li><p>Fokus: AoT</p></li><li><p>Mehrteilig:</p><div class="ulist"><ul><li><p>Graal VM & Substrate VM as runtime</p></li></ul></div></li><li><p>Benefits</p><div class="ulist"><ul><li><p>AoT → schnellere Startzeiten vs. JIT</p></li><li><p>Native Images → kleinere Startup/Memory → Container</p></li><li><p>Limitations: Dynamic (Reflection)</p></li><li><p>Beeindruckend: GraalVM ab 21.2 unterstützt ebenfalls JFR</p></li></ul></div></li><li><p>Commercial offerings "GraalVM Enterprise"</p></li><li><p>zahlreiche Frameworks zielen auf GraalVM AoT & Microservices</p><div class="ulist"><ul><li><p>z.B. IoC zur Compiletime via APT vs. Laufzeit</p></li></ul></div></li></ol></div></aside></div></section></section>
<section id="_vielen_dank" class="lightbg stretch" data-background-video="images/industrial.mp4" data-background-video-loop data-background-opacity="0.6"><h2>Vielen Dank!</h2><div class="slide-content"><div class="openblock col3-l x-small"><div class="content"><div class="ulist"><div class="title">Tools</div><ul><li><p><a href="https://openjdk.java.net/projects/jmc/8/">JDK Flight Mission Control 8</a></p></li><li><p><a href="https://www.graalvm.org/">GraalVM</a></p></li><li><p><a href="https://jdk.java.net/panama/">Panama EAP Builds (<code>jextract</code>)</a></p></li></ul></div>
<div class="ulist"><div class="title">Frameworks</div><ul><li><p><a href="https://github.com/quick-perf/quickperf">QuickPerf</a></p></li><li><p><a href="https://github.com/moditect/jfrunit">JfrUnit</a></p></li><li><p><a href="https://helidon.io/#/">helidon.io</a></p></li><li><p><a href="https://micronaut.io/">micronaut.io</a></p></li><li><p><a href="https://quarkus.io/">quarkus.io</a></p></li><li><p><a href="https://github.com/spring-projects-experimental/spring-fu">Spring Fu</a></p></li><li><p><a href="https://ktor.io/">Ktor.io</a></p></li></ul></div></div></div>
<div class="openblock col3-c x-small"><div class="content"><div class="ulist"><div class="title">Referenzwerke</div><ul><li><p><a href="https://javaalmanac.io/">Java Almanac</a></p></li><li><p><a href="https://bestsolution-at.github.io/jfr-doc/">JFR Eventtypen</a></p></li><li><p><a href="https://chriswhocodes.com/vm-options-explorer.html">VM Options Explorer</a></p></li><li><p><a href="https://docs.oracle.com/en/java/javase/17/gctuning/available-collectors.html">HotSpot Tuning Guide: Available Collectors</a></p></li><li><p><a href="https://github.com/sundararajana/panama-jextract-samples"><code>jextract</code>-Examples</a></p></li></ul></div>
<div class="ulist"><div class="title">Artikel</div><ul><li><p><a href="https://blog.arkey.fr/2021/09/04/a-practical-look-at-jep-412-in-jdk17-with-libsodium/">A practical look at JEP-412</a></p></li><li><p><a href="https://docs.oracle.com/en/java/javase/14/vm/class-data-sharing.html">Application Class-Data Sharing</a></p></li><li><p><a href="http://www.oracle.com/pls/topic/lookup?ctx=javase14&id=dynamic_CDS_archive">Dynamic CDS Archive</a></p></li><li><p><a href="https://blogs.oracle.com/javamagazine/understanding-the-jdks-new-superfast-garbage-collectors">Understanding the JDK’s New fast GCs</a></p></li><li><p><a href="https://entwickler.de/java/kurze-pause">Kurze Pause</a></p></li><li><p><a href="https://www.youtube.com/watch?v=B8k9QGvPxC0">State of Project Panama</a></p></li></ul></div></div></div>
<div class="openblock col3-r x-small"><div class="content"><div class="paragraph"><p><span class="image"><img src="images/java17-lts-presentation-url.png" alt="https://bentolor.github.io/java17-lts-presentation/"></span><br>
<span class="emphasize"><strong>Interaktive HTML5 Version<br>
mit allen Links & Demovideos</strong></span></p></div>
<div class="paragraph"><p> <br></p></div>
<div class="paragraph"><p><span class="icon"><i class="fa fa-twitter"></i></span> <a href="https://twitter.com/bentolor"><strong>@bentolor</strong></a><br>
<span class="icon"><i class="fa fa-at"></i></span> <a href="mailto:[email protected]">[email protected]</a><br>
<span class="icon"><i class="fa fa-github"></i></span> <a href="https://github.com/bentolor/java17-lts-presentation">bentolor/java17-lts-presentation</a></p></div>
<div class="paragraph xx-small decent"><p>Proudly made with:
<a href="https://docs.asciidoctor.org/reveal.js-converter/latest/"><code>asciidoctor-revealjs</code></a>, <a href="https://www.pexels.com/">pexels.com Videos</a> & <a href="https://de.freeimages.com/">freeimages.com images</a></p></div></div></div>
<script src="./live.js"></script></div></section></div></div><script src="reveal.js/js/reveal.js"></script><script>Array.prototype.slice.call(document.querySelectorAll('.slides section')).forEach(function(slide) {
if (slide.getAttribute('data-background-color')) return;
// user needs to explicitly say he wants CSS color to override otherwise we might break custom css or theme (#226)
if (!(slide.classList.contains('canvas') || slide.classList.contains('background'))) return;
var bgColor = getComputedStyle(slide).backgroundColor;
if (bgColor !== 'rgba(0, 0, 0, 0)' && bgColor !== 'transparent') {
slide.setAttribute('data-background-color', bgColor);
slide.style.backgroundColor = 'transparent';
}
});
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
// Display presentation control arrows
controls: true,
// Help the user learn the controls by providing hints, for example by
// bouncing the down arrow when they first encounter a vertical slide
controlsTutorial: true,
// Determines where controls appear, "edges" or "bottom-right"
controlsLayout: 'edges',
// Visibility rule for backwards navigation arrows; "faded", "hidden"
// or "visible"
controlsBackArrows: 'faded',
// Display a presentation progress bar
progress: true,
// Display the page number of the current slide
slideNumber: 'c/t',
// Control which views the slide number displays on
showSlideNumber: 'speaker',
// Add the current slide number to the URL hash so that reloading the
// page/copying the URL will return you to the same slide
hash: false,
// Push each slide change to the browser history. Implies `hash: true`
history: true,
// Enable keyboard shortcuts for navigation
keyboard: true,
// Enable the slide overview mode
overview: true,
// Disables the default reveal.js slide layout so that you can use custom CSS layout
disableLayout: false,
// Vertical centering of slides
center: true,
// Enables touch navigation on devices with touch input
touch: true,
// Loop the presentation
loop: false,
// Change the presentation direction to be RTL
rtl: false,
// See https://github.com/hakimel/reveal.js/#navigation-mode
navigationMode: 'default',
// Randomizes the order of slides each time the presentation loads
shuffle: false,
// Turns fragments on and off globally
fragments: false,
// Flags whether to include the current fragment in the URL,
// so that reloading brings you to the same fragment position
fragmentInURL: true,
// Flags if the presentation is running in an embedded mode,
// i.e. contained within a limited portion of the screen
embedded: false,
// Flags if we should show a help overlay when the questionmark
// key is pressed
help: true,
// Flags if speaker notes should be visible to all viewers
showNotes: false,
// Global override for autolaying embedded media (video/audio/iframe)
// - null: Media will only autoplay if data-autoplay is present
// - true: All media will autoplay, regardless of individual setting
// - false: No media will autoplay, regardless of individual setting
autoPlayMedia: true,
// Global override for preloading lazy-loaded iframes
// - null: Iframes with data-src AND data-preload will be loaded when within
// the viewDistance, iframes with only data-src will be loaded when visible
// - true: All iframes with data-src will be loaded when within the viewDistance
// - false: All iframes with data-src will be loaded only when visible
preloadIframes: null,
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: 0,
// Stop auto-sliding after user input
autoSlideStoppable: true,
// Use this method for navigation when auto-sliding
autoSlideMethod: Reveal.navigateNext,
// Specify the average time in seconds that you think you will spend
// presenting each slide. This is used to show a pacing timer in the
// speaker view
defaultTiming: 49,
// Specify the total time in seconds that is available to
// present. If this is set to a nonzero value, the pacing
// timer will work out the time available for each slide,
// instead of using the defaultTiming value
totalTime: 0,
// Specify the minimum amount of time you want to allot to
// each slide, if using the totalTime calculation method. If
// the automated time allocation causes slide pacing to fall
// below this threshold, then you will see an alert in the
// speaker notes window
minimumTimePerSlide: 0,
// Enable slide navigation via mouse wheel
mouseWheel: false,
// Hide cursor if inactive
hideInactiveCursor: true,
// Time before the cursor is hidden (in ms)
hideCursorTime: 5000,
// Hides the address bar on mobile devices
hideAddressBar: true,
// Opens links in an iframe preview overlay
// Add `data-preview-link` and `data-preview-link="false"` to customise each link
// individually
previewLinks: false,
// Transition style (e.g., none, fade, slide, convex, concave, zoom)
transition: 'slide',
// Transition speed (e.g., default, fast, slow)
transitionSpeed: 'default',
// Transition style for full page slide backgrounds (e.g., none, fade, slide, convex, concave, zoom)
backgroundTransition: 'fade',
// Number of slides away from the current that are visible
viewDistance: 3,
// Number of slides away from the current that are visible on mobile
// devices. It is advisable to set this to a lower number than
// viewDistance in order to save resources.
mobileViewDistance: 3,
// Parallax background image (e.g., "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'")
parallaxBackgroundImage: 'images/what-s-under-the-hood-1560145-light.jpg',
// Parallax background size in CSS syntax (e.g., "2100px 900px")
parallaxBackgroundSize: '5000px 3376px',
// Number of pixels to move the parallax background per slide
// - Calculated automatically unless specified
// - Set to 0 to disable movement along an axis
parallaxBackgroundHorizontal: null,
parallaxBackgroundVertical: null,
// The display mode that will be used to show slides
display: 'block',
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1408,
height: 792,
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.5,
// PDF Export Options
// Put each fragment on a separate page
pdfSeparateFragments: true,
// For slides that do not fit on a page, max number of pages
pdfMaxPagesPerSlide: 1,
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
],
});</script><script>var dom = {};
dom.slides = document.querySelector('.reveal .slides');
function getRemainingHeight(element, slideElement, height) {
height = height || 0;
if (element) {
var newHeight, oldHeight = element.style.height;
// Change the .stretch element height to 0 in order find the height of all
// the other elements
element.style.height = '0px';
// In Overview mode, the parent (.slide) height is set of 700px.
// Restore it temporarily to its natural height.
slideElement.style.height = 'auto';
newHeight = height - slideElement.offsetHeight;
// Restore the old height, just in case
element.style.height = oldHeight + 'px';
// Clear the parent (.slide) height. .removeProperty works in IE9+
slideElement.style.removeProperty('height');
return newHeight;
}
return height;
}
function layoutSlideContents(width, height) {
// Handle sizing of elements with the 'stretch' class
toArray(dom.slides.querySelectorAll('section .stretch')).forEach(function (element) {
// Determine how much vertical space we can use
var limit = 5; // hard limit
var parent = element.parentNode;
while (parent.nodeName !== 'SECTION' && limit > 0) {
parent = parent.parentNode;
limit--;
}
if (limit === 0) {
// unable to find parent, aborting!
return;
}
var remainingHeight = getRemainingHeight(element, parent, height);
// Consider the aspect ratio of media elements
if (/(img|video)/gi.test(element.nodeName)) {
var nw = element.naturalWidth || element.videoWidth, nh = element.naturalHeight || element.videoHeight;
var es = Math.min(width / nw, remainingHeight / nh);
element.style.width = (nw * es) + 'px';
element.style.height = (nh * es) + 'px';
} else {
element.style.width = width + 'px';
element.style.height = remainingHeight + 'px';
}
});
}
function toArray(o) {
return Array.prototype.slice.call(o);
}
Reveal.addEventListener('slidechanged', function () {
layoutSlideContents(1408, 792)
});
Reveal.addEventListener('ready', function () {
layoutSlideContents(1408, 792)
});
Reveal.addEventListener('resize', function () {
layoutSlideContents(1408, 792)
});</script><link rel="stylesheet" href="css/atom-one-light.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script>
/* highlightjs-line-numbers.js 2.6.0 | (C) 2018 Yauheni Pakala | MIT License | github.com/wcoder/highlightjs-line-numbers.js */
/* Edited by Hakim for reveal.js; removed async timeout */
!function(n,e){"use strict";function t(){var n=e.createElement("style");n.type="text/css",n.innerHTML=g(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[v,L,b]),e.getElementsByTagName("head")[0].appendChild(n)}function r(t){"interactive"===e.readyState||"complete"===e.readyState?i(t):n.addEventListener("DOMContentLoaded",function(){i(t)})}function i(t){try{var r=e.querySelectorAll("code.hljs,code.nohighlight");for(var i in r)r.hasOwnProperty(i)&&l(r[i],t)}catch(o){n.console.error("LineNumbers error: ",o)}}function l(n,e){"object"==typeof n&&f(function(){n.innerHTML=s(n,e)})}function o(n,e){if("string"==typeof n){var t=document.createElement("code");return t.innerHTML=n,s(t,e)}}function s(n,e){e=e||{singleLine:!1};var t=e.singleLine?0:1;return c(n),a(n.innerHTML,t)}function a(n,e){var t=u(n);if(""===t[t.length-1].trim()&&t.pop(),t.length>e){for(var r="",i=0,l=t.length;i<l;i++)r+=g('<tr><td class="{0}"><div class="{1} {2}" {3}="{5}"></div></td><td class="{4}"><div class="{1}">{6}</div></td></tr>',[j,m,L,b,p,i+1,t[i].length>0?t[i]:" "]);return g('<table class="{0}">{1}</table>',[v,r])}return n}function c(n){var e=n.childNodes;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];h(r.textContent)>0&&(r.childNodes.length>0?c(r):d(r.parentNode))}}function d(n){var e=n.className;if(/hljs-/.test(e)){for(var t=u(n.innerHTML),r=0,i="";r<t.length;r++){var l=t[r].length>0?t[r]:" ";i+=g('<span class="{0}">{1}</span>\n',[e,l])}n.innerHTML=i.trim()}}function u(n){return 0===n.length?[]:n.split(y)}function h(n){return(n.trim().match(y)||[]).length}function f(e){e()}function g(n,e){return n.replace(/{(\d+)}/g,function(n,t){return e[t]?e[t]:n})}var v="hljs-ln",m="hljs-ln-line",p="hljs-ln-code",j="hljs-ln-numbers",L="hljs-ln-n",b="data-line-number",y=/\r\n|\r|\n/g;n.hljs?(n.hljs.initLineNumbersOnLoad=r,n.hljs.lineNumbersBlock=l,n.hljs.lineNumbersValue=o,t()):n.console.error("highlight.js not detected!")}(window,document);
/**
* This reveal.js plugin is wrapper around the highlight.js
* syntax highlighting library.
*/
(function( root, factory ) {
if (typeof define === 'function' && define.amd) {
root.RevealHighlight = factory();
} else if( typeof exports === 'object' ) {
module.exports = factory();
} else {
// Browser globals (root is window)
root.RevealHighlight = factory();
}
}( this, function() {
// Function to perform a better "data-trim" on code snippets
// Will slice an indentation amount on each line of the snippet (amount based on the line having the lowest indentation length)
function betterTrim(snippetEl) {
// Helper functions
function trimLeft(val) {
// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
return val.replace(/^[\s\uFEFF\xA0]+/g, '');
}
function trimLineBreaks(input) {
var lines = input.split('\n');
// Trim line-breaks from the beginning
for (var i = 0; i < lines.length; i++) {
if (lines[i].trim() === '') {
lines.splice(i--, 1);
} else break;
}
// Trim line-breaks from the end
for (var i = lines.length-1; i >= 0; i--) {
if (lines[i].trim() === '') {
lines.splice(i, 1);
} else break;
}
return lines.join('\n');
}
// Main function for betterTrim()
return (function(snippetEl) {
var content = trimLineBreaks(snippetEl.innerHTML);
var lines = content.split('\n');
// Calculate the minimum amount to remove on each line start of the snippet (can be 0)
var pad = lines.reduce(function(acc, line) {
if (line.length > 0 && trimLeft(line).length > 0 && acc > line.length - trimLeft(line).length) {
return line.length - trimLeft(line).length;
}
return acc;
}, Number.POSITIVE_INFINITY);
// Slice each line with this amount
return lines.map(function(line, index) {
return line.slice(pad);
})
.join('\n');
})(snippetEl);
}