SlideShare a Scribd company logo
1 of 37
Download to read offline
W-JAX 6. November 2013

Memory Management: TP, CMS und G1

Welche GC-Strategie ist die richtige?
Tobias@Frech.info / @TobiasFrech
Tobias Frech

Java ­ Administrator
© Tobias@Frech.info

W-JAX 6. November 2013

2
iJUG e.V.
Interessenverbund der Java User Groups e.V.
http://www.ijug.eu/ @iJUGeV
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●

© Tobias@Frech.info

W-JAX 6. November 2013

●

BED-Con e.V.
DOAG e.V.
JUG Augsburg
JUG Bremen
JUG Darmstadt
JUG Deutschland e.V.
JUG Erlangen–Nürnberg
JUG Hannover
JUG Karlsruhe
JUG Köln
JUG München
JUG Münster
JUG Ostfalen
JUG Saxony
JUG Stuttgart e.V.
JSUG
SOUG e.V.
SUG Deutschland e.V. 3
Objekte oder Garbage?

© Tobias@Frech.info

W-JAX 6. November 2013

4
Garbage Collection

© Tobias@Frech.info

W-JAX 6. November 2013

5
GC Optimierung
●

Objekte nach der
Lebensdauer
sortiert:

●

Einführung von
Generationen:

wenige
wenige
langlebige Objekte
langlebige Objekte

Tenured
Tenured
Generation
Generation
Heap
(-Xmx...)

sehr viele
sehr viele
kurzlebige Objekte
kurzlebige Objekte
© Tobias@Frech.info

Survior

Survior

Young
Young
Generation
Generation
W-JAX 6. November 2013

6
GC Logging
●

GC-Logs ausgeben:
●

●

GC-Logs nicht überschreiben:
●

●

-XX:+PrintGC und -XX:+PrintGCDetails

-Xloggc:gc.log_`date +%F_%T`

Für die Menschen unter uns:
●

●

●

-XX:-PrintGCTimeStamps
-XX:+PrintGCDateStamps

Für die Admins:
●

-XX:+UseGCLogFileRotation

●

-XX:GCLogFileSize=, -XX:NumberOfGCLogFiles=

© Tobias@Frech.info

W-JAX 6. November 2013

7
Throughput – GC - Log
(201828s = 2 Tage 8 Stunden 3 Minuten 48 Sekunden)

201828.280: [GC
[PSYoungGen: 1816941K->29609K(4072576K)]
3126522K->1400938K(12461184K), 0.2465840 secs]
[Times: user=0.44 sys=0.00, real=0.24 secs]
201828.527: [Full GC (System)
[PSYoungGen: 29609K->0K(4072576K)]
[ParOldGen: 1371329K->1154377K(8388608K)]
1400938K->1154377K(12461184K)
[PSPermGen: 181489K->181449K(182528K)],
3.3035730 secs]
[Times: user=5.98 sys=0.00, real=3.31 secs]
© Tobias@Frech.info

W-JAX 6. November 2013

8
GC Ergonomics

-Xmx
aus http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
© Tobias@Frech.info

W-JAX 6. November 2013

9
TP - Ergonomics – GC - Log
0,187: [GC [PSYoungGen: 3072K->496K(3584K)] 3072K>508K(9088K), 0,0020340 secs] [Times: user=0,00 sys=0,00, real=0,00
secs]
1,481: [GC [PSYoungGen: 9168K->400K(9856K)] 11059K>2467K(15360K), 0,0022780 secs] [Times: user=0,00 sys=0,00,
real=0,00 secs]
2,747: [Full GC [PSYoungGen: 352K->0K(9472K)] [ParOldGen: 5106K>4316K(9408K)] 5458K->4316K(18880K) [PSPermGen: 1981K>1980K(16384K)], 0,0361440 secs] [Times: user=0,05 sys=0,00,
real=0,03 secs]
5,839: [Full GC [PSYoungGen: 336K->0K(9984K)] [ParOldGen: 9133K>8668K(15936K)] 9469K->8668K(25920K) [PSPermGen: 1980K>1980K(16384K)], 0,0718830 secs] [Times: user=0,10 sys=0,00,
real=0,07 secs]
9,457: [Full GC [PSYoungGen: 352K->0K(9152K)] [ParOldGen:
16003K->13835K(21888K)] 16355K->13835K(31040K) [PSPermGen:
1980K->1980K(16384K)], 0,0782570 secs] [Times: user=0,10
sys=0,00, real=0,07 secs]
© Tobias@Frech.info

W-JAX 6. November 2013

10
Performance und GC
●

Unterschiedliche Zielsetzungen
●
●

●

Durchsatz
Antwortzeit

Strategien für die GC auswählen
●

falsche Strategie kann verheerende
Auswirkungen auf die SLA haben

© Tobias@Frech.info

W-JAX 6. November 2013

11
Multicore, Parallelisierung

Serial

Parallel

-XX:+UseParallelGC / -XX:+UseParallelOldGC

© Tobias@Frech.info

W-JAX 6. November 2013

12
Concurrency

Concurrent

Parallel

© Tobias@Frech.info

W-JAX 6. November 2013

13
Concurrent Mark and Sweep

-XX:+UseConcMarkSweepGC
© Tobias@Frech.info

W-JAX 6. November 2013

14
CMS GC – Log I
108238.954: [GC 108238.954: [ParNew: 1561405K>38199K(2831168K), 0.1625150 secs] 2210735K>687532K(12268352K), 0.1628820 secs]
[Times: user=0.30 sys=0.00, real=0.16 secs]
108239.124: [GC [1 CMS-initial-mark: 649332K(9437184K)]
687558K(12268352K), 0.0279780 secs]
[Times: user=0.02 sys=0.00, real=0.03 secs]
108239.152: [CMS-concurrent-mark-start]
108240.555: [CMS-concurrent-mark: 1.403/1.403 secs]
[Times: user=1.40 sys=0.00, real=1.40 secs]
108240.555: [CMS-concurrent-preclean-start]
108240.600: [CMS-concurrent-preclean: 0.045/0.045 secs]
[Times: user=0.04 sys=0.00, real=0.04 secs]
© Tobias@Frech.info

W-JAX 6. November 2013

15
CMS GC – Log II
108240.600: [CMS-concurrent-abortable-preclean-start]
CMS: abort preclean due to time
108245.863: [CMS-concurrent-abortable-preclean: 3.937/5.263 secs]
[Times: user=3.84 sys=0.00, real=5.26 secs]
108245.865: [GC[YG occupancy: 61713 K (2831168 K)]108245.865:
[Rescan (parallel) , 0.0785890 secs]108245.943: [weak refs processing,
0.0000770 secs]108245.944: [scrub string table, 0.0039600 secs] [1
CMS-remark: 649332K(9437184K)] 711045K(12268352K), 0.0828430
secs] [Times: user=0.07 sys=0.00, real=0.08 secs]
108245.948: [CMS-concurrent-sweep-start]
108246.333: [CMS-concurrent-sweep: 0.385/0.385 secs]
[Times: user=0.38 sys=0.00, real=0.38 secs]
108246.334: [CMS-concurrent-reset-start]
108246.365: [CMS-concurrent-reset: 0.032/0.032 secs]
[Times: user=0.04 sys=0.00, real=0.04 secs]
© Tobias@Frech.info

W-JAX 6. November 2013

16
Situation bisher
●

Throughput Collector (TP)
●

●

selbst-tunend

●

●

optimiert auf Durchsatz
De-Fragmentierung zuschaltbar / neuer Default

Concurrent Mark and Sweep (CMS)
●

optimiert auf Antwortzeit

●

De-Fragmentierung nur in STW-Full-GCs

●

Heuristik spielt entscheidende Rolle

●

Tuning von Hand notwendig

© Tobias@Frech.info

W-JAX 6. November 2013

17
Garbage First
●

Wunschliste:
●

kurze Pausenzeiten

●

vorhersagbares Verhalten

●

De-Fragmentierung

●

massiv skalierbar (Multicore)

●

kein Tuning notwendig

●

große Heapgrößen unterstützt

© Tobias@Frech.info

W-JAX 6. November 2013

18
Garbage First G1 - Theorie
●

Feste Einteilung des Speichers in Regions
●
●

●

●

min. 1 MB
Ziel ca. 2000 Regions

Auswahl der „am meisten Erfolg
versprechenden“ Regions für GC-Lauf
Aufräumen:
●

Evakuierung der noch lebenden Objekte
(„Evacuation Pause“)

●

leere Region ist dann wieder verfügbar

●

Collection Set (CSet)

© Tobias@Frech.info

W-JAX 6. November 2013

19
Garbage First
●

1MB Regions

-XX:+UseG1GC

© Tobias@Frech.info

W-JAX 6. November 2013

20
Garbage First - Praxis
●

Young-, Survior- und Old-Regions

●

Concurrent Marking und Evacuation Pauses

●

Vorteil gegenüber CMS:
●

●

Ziel: kein Tuning notwendig

●

●

Defragmentierung
Ziel: STW-Phase mit festgelegter Dauer

Full-GC wenn Speicher nicht mehr ausreicht
●

bisher keine Parallelisierung!

© Tobias@Frech.info

W-JAX 6. November 2013

21
G1 GC – Log: Evacuation
222515.738: [GC pause (young), 0.38581200 secs]
[Parallel Time: 370.2 ms]
[GC Worker Start (ms): 222515738.3 222515738.4
Avg: 222515738.4, Min: 222515738.3, Max: 222515738.4, Diff: 0.0]
[Ext Root Scanning (ms): 43.2 43.1
Avg: 43.2, Min: 43.1, Max: 43.2, Diff: 0.1]
[Update RS (ms): 7.2 8.7
Avg: 8.0, Min: 7.2, Max: 8.7, Diff: 1.4]
[Processed Buffers : 80 69
Sum: 149, Avg: 74, Min: 69, Max: 80, Diff: 11]
[Scan RS (ms): 17.0 17.0
Avg: 17.0, Min: 17.0, Max: 17.0, Diff: 0.0]
[Object Copy (ms): 297.0 295.6
Avg: 296.3, Min: 295.6, Max: 297.0, Diff: 1.4]
[Termination (ms): 0.0 0.0
Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0]
[Termination Attempts : 1 1
Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0]
...
© Tobias@Frech.info

W-JAX 6. November 2013

22
G1 GC – Log: Evacuation
...

[GC Worker End (ms): 222516102.8 222516102.8
Avg: 222516102.8, Min: 222516102.8, Max: 222516102.8, Diff: 0.0]
[GC Worker (ms): 364.5 364.5
Avg: 364.5, Min: 364.5, Max: 364.5, Diff: 0.0]
[GC Worker Other (ms): 5.8 5.8
Avg: 5.8, Min: 5.8, Max: 5.8, Diff: 0.0]
[Clear CT: 0.9 ms]
[Other: 14.7 ms]
[Choose CSet: 0.1 ms]
[Ref Proc: 11.2 ms]
[Ref Enq: 0.1 ms]
[Free CSet: 2.6 ms]
[Eden: 2284M(2284M)->0B(2284M) Survivors: 172M->172M
Heap: 7461M(12288M)->5189M(12288M)]
[Times: user=0.75 sys=0.00, real=0.38 secs]

© Tobias@Frech.info

W-JAX 6. November 2013

23
G1 GC – Log: Concurrent
222879.431: [GC pause (young) (initial-mark), 0.62468900 secs]
...
[Eden: 2272M(2272M)->0B(2272M) Survivors: 184M->184M Heap:
7555M(12288M)->5306M(12288M)]
[Times: user=1.19 sys=0.01, real=0.63 secs]
222880.056: [GC concurrent-root-region-scan-start]
222880.560: [GC concurrent-root-region-scan-end, 0.5045520]
222880.560: [GC concurrent-mark-start]
222885.610: [GC concurrent-mark-end, 5.0490610 sec]
222885.611: [GC remark 222885.612: [GC ref-proc, 0.0143660 secs], 0.0829630
secs]
[Times: user=0.07 sys=0.00, real=0.07 secs]
222885.699: [GC cleanup 5375M->4924M(12288M), 0.0548790 secs]
[Times: user=0.07 sys=0.00, real=0.05 secs]
222885.754: [GC concurrent-cleanup-start]
222885.755: [GC concurrent-cleanup-end, 0.0008480]
© Tobias@Frech.info

W-JAX 6. November 2013

24
G1 GC – Log: Evacuation
223007.294: [GC pause (mixed), 0.37419100 secs]
[Parallel Time: 350.0 ms]
...
[GC Worker End (ms): 223007638.5 223007638.5
Avg: 223007638.5, Min: 223007638.5, Max: 223007638.5, Diff: 0.0]
[GC Worker (ms): 342.6 342.6
Avg: 342.6, Min: 342.6, Max: 342.6, Diff: 0.0]
[GC Worker Other (ms): 7.4 7.5
Avg: 7.4, Min: 7.4, Max: 7.5, Diff: 0.0]
[Clear CT: 1.3 ms]
[Other: 22.9 ms]
[Choose CSet: 1.9 ms]
[Ref Proc: 15.1 ms]
[Ref Enq: 0.1 ms]
[Free CSet: 5.0 ms]
[Eden: 2316M(2316M)->0B(2300M) Survivors: 140M->156M
Heap: 7160M(12288M)->3988M(12288M)]
[Times: user=0.71 sys=0.00, real=0.37 secs]
Details unter https://blogs.oracle.com/poonam/
© Tobias@Frech.info

W-JAX 6. November 2013

25
GC im Lasttest
●

Lasttest mit rein interaktiver (HTTP) Last

●

Linux-VM mit 12GB RAM, 6 VCPU

●

JVM mit -Xmx8g

●

Testläufe:
●

●

JDK 7 Update 7, TP-Collector

●

●

JDK 6 Update 31, TP-Collector
JDK 7 Update 7, G1-Collector (-XX:+UseG1GC)

Aufbereitung der „jstat -gc“-Ausgabe mit 10Sekunden-Intervall

© Tobias@Frech.info

W-JAX 6. November 2013

26
JDK 6, TP-Collector

© Tobias@Frech.info

W-JAX 6. November 2013

27
JDK 7, TP-Collector

© Tobias@Frech.info

W-JAX 6. November 2013

28
JDK 7, G1-Collector

© Tobias@Frech.info

W-JAX 6. November 2013

29
Vergleich TP / CMS / G1
●

Produktivsystem
●

●

●

4 VMs

kein Speichermangel
Auswertung des GC-Log
(-XX:+PrintGCDetails)

© Tobias@Frech.info

W-JAX 6. November 2013

30
TP – GC in Produktion
12

10

8

6

4

2

0
0

50000

© Tobias@Frech.info

100000

150000

200000

W-JAX 6. November 2013

250000

300000

350000

31
CMS – GC in Produktion
1,4

1,2

1

0,8

0,6

0,4

0,2

0
0

50000

© Tobias@Frech.info

100000

150000

200000

W-JAX 6. November 2013

250000

300000

350000

32
G1 – GC in Produktion
4

3,5

3

2,5

2

1,5

1

0,5

0
0

50000

© Tobias@Frech.info

100000

150000

200000

W-JAX 6. November 2013

250000

300000

350000

33
G1 Switches
●

Alle JVM-Switches ausgeben:
java -XX:+UnlockDiagnosticVMOptions -XX:
+PrintFlagsFinal -version

●

G1-Ergonomics-Entscheidungen ausgeben:
-XX:+PrintAdaptiveSizePolicy

●

Zielvorgabe für Pausen:
-XX:MaxGCPauseMillis=200

© Tobias@Frech.info

W-JAX 6. November 2013

34
GC - Entscheidung
●

„Don't try to fix me, I'm not broken“ (Evanescence)

●

Wirksamkeit von Optimierungen sicherstellen
●

Messen notwendig (besser als Bauchgefühl)
Throughput-Collector
STW-Phasen zu lang?

nein

:-)

G1-Collector
STW-Phasen zu lang?

nein

CMS-Collector
© Tobias@Frech.info

CMS-Tuning
W-JAX 6. November 2013

35
Ressourcen
●

VisualVM Plugin „GC Viewer“
●

●

Artikel JVM-Tools
●

●

http://java.dzone.com/articles/visualvm-gcviewer-plugin
http://frech.info/meins/Tobias_Frech_2010_Java_aktuell_1.pdf

Tools für Log-Files:
●

●

●

GCViewer: https://github.com/chewiebug/GCViewer
GCHisto: http://java.net/projects/gchisto

Dokumentation:
●

GC Whitepaper:

http://www.oracle.com/technetwork/java/javase/memorymanagement-whitepaper-150215.pdf
●

G1-Tuning:

https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=6583
http://www.slideshare.net/MonicaBeckwith/garbage-first-garbage-collector-g1-gc-migration-to-expectations-and-advanced-tu
ning

© Tobias@Frech.info

W-JAX 6. November 2013

36
Vielen Dank!

follow me
@TobiasFrech
W-JAX 6. November 2013
© Tobias@Frech.info
CC BY-SA 2.0 Richard Slessor

37

More Related Content

What's hot

What's hot (20)

Integrating Puppet and Gitolite for sysadmins cooperations
Integrating Puppet and Gitolite for sysadmins cooperationsIntegrating Puppet and Gitolite for sysadmins cooperations
Integrating Puppet and Gitolite for sysadmins cooperations
 
Java memory problem cases solutions
Java memory problem cases solutionsJava memory problem cases solutions
Java memory problem cases solutions
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
 
OpenHFT: An Advanced Java Data Locality and IPC Transport Solution
OpenHFT: An Advanced Java Data Locality and IPC Transport SolutionOpenHFT: An Advanced Java Data Locality and IPC Transport Solution
OpenHFT: An Advanced Java Data Locality and IPC Transport Solution
 
Building a Big Data Machine Learning Platform
Building a Big Data Machine Learning PlatformBuilding a Big Data Machine Learning Platform
Building a Big Data Machine Learning Platform
 
Progress_190315
Progress_190315Progress_190315
Progress_190315
 
Scaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaS
Scaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaSScaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaS
Scaling Jakarta EE Applications Vertically and Horizontally with Jelastic PaaS
 
LAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backportingLAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backporting
 
Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop
 
コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!コミュニティ開発に参加しよう!
コミュニティ開発に参加しよう!
 
Task migration using CRIU
Task migration using CRIUTask migration using CRIU
Task migration using CRIU
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
Rocks db state store in structured streaming
Rocks db state store in structured streamingRocks db state store in structured streaming
Rocks db state store in structured streaming
 
Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)Analyzing Java Applications Using Thermostat (Omair Majid)
Analyzing Java Applications Using Thermostat (Omair Majid)
 
Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016Debugging Distributed Systems - Velocity Santa Clara 2016
Debugging Distributed Systems - Velocity Santa Clara 2016
 
Ultrasound Image Viewer - Qt + SGX
Ultrasound Image Viewer - Qt + SGXUltrasound Image Viewer - Qt + SGX
Ultrasound Image Viewer - Qt + SGX
 
Java 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgradeJava 9/10/11 - What's new and why you should upgrade
Java 9/10/11 - What's new and why you should upgrade
 
The Ruby GC is your friend!
The Ruby GC is your friend!The Ruby GC is your friend!
The Ruby GC is your friend!
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOM
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 

Viewers also liked

Huacho, por Irene y Andrea
Huacho, por Irene y AndreaHuacho, por Irene y Andrea
Huacho, por Irene y Andrea
labordetaingles
 
project star certificate
project star certificateproject star certificate
project star certificate
Rahat Parveen
 
Ficha autismo
Ficha autismoFicha autismo
Ficha autismo
Vidacord
 
Icwガイドブック2014版スコラ・コンサルト2
Icwガイドブック2014版スコラ・コンサルト2Icwガイドブック2014版スコラ・コンサルト2
Icwガイドブック2014版スコラ・コンサルト2
Takiguchi Takeshi
 
Sixth Grade Basketball Curriculum Downers Grove Park District
Sixth Grade Basketball Curriculum Downers Grove Park DistrictSixth Grade Basketball Curriculum Downers Grove Park District
Sixth Grade Basketball Curriculum Downers Grove Park District
Jeff Smith
 
Social Media Marketing in academic libraries 2013
Social Media Marketing in academic libraries 2013Social Media Marketing in academic libraries 2013
Social Media Marketing in academic libraries 2013
Heidi Card
 

Viewers also liked (20)

Como crear un blog
Como crear un blogComo crear un blog
Como crear un blog
 
Velhice
VelhiceVelhice
Velhice
 
Huacho, por Irene y Andrea
Huacho, por Irene y AndreaHuacho, por Irene y Andrea
Huacho, por Irene y Andrea
 
Partitivo
PartitivoPartitivo
Partitivo
 
Virus informatico
Virus informaticoVirus informatico
Virus informatico
 
Kamenets podolsky. (1)
Kamenets podolsky. (1)Kamenets podolsky. (1)
Kamenets podolsky. (1)
 
project star certificate
project star certificateproject star certificate
project star certificate
 
Ficha autismo
Ficha autismoFicha autismo
Ficha autismo
 
Icwガイドブック2014版スコラ・コンサルト2
Icwガイドブック2014版スコラ・コンサルト2Icwガイドブック2014版スコラ・コンサルト2
Icwガイドブック2014版スコラ・コンサルト2
 
Sixth Grade Basketball Curriculum Downers Grove Park District
Sixth Grade Basketball Curriculum Downers Grove Park DistrictSixth Grade Basketball Curriculum Downers Grove Park District
Sixth Grade Basketball Curriculum Downers Grove Park District
 
Musipoesía año 2012 2013 número 7
Musipoesía año 2012 2013 número 7Musipoesía año 2012 2013 número 7
Musipoesía año 2012 2013 número 7
 
A02 matthew adams_keynote_paperless
A02 matthew adams_keynote_paperlessA02 matthew adams_keynote_paperless
A02 matthew adams_keynote_paperless
 
Information Literacy 2009
Information Literacy 2009Information Literacy 2009
Information Literacy 2009
 
Find and work with your technical cofounder
Find and work with your technical cofounderFind and work with your technical cofounder
Find and work with your technical cofounder
 
Salud entre la actividad física y el sedentarismo
Salud entre la actividad física y el sedentarismoSalud entre la actividad física y el sedentarismo
Salud entre la actividad física y el sedentarismo
 
Social Media Marketing in academic libraries 2013
Social Media Marketing in academic libraries 2013Social Media Marketing in academic libraries 2013
Social Media Marketing in academic libraries 2013
 
مراجعة الصف الثانى الثانوى لشهر نوفمبر
مراجعة الصف الثانى الثانوى لشهر نوفمبرمراجعة الصف الثانى الثانوى لشهر نوفمبر
مراجعة الصف الثانى الثانوى لشهر نوفمبر
 
Smarter commerce day 2015 - Fiwes presentation
Smarter commerce day 2015 - Fiwes presentationSmarter commerce day 2015 - Fiwes presentation
Smarter commerce day 2015 - Fiwes presentation
 
Футбол (Украина) №095 "MYFOOTBALL.WS"
Футбол (Украина) №095 "MYFOOTBALL.WS" Футбол (Украина) №095 "MYFOOTBALL.WS"
Футбол (Украина) №095 "MYFOOTBALL.WS"
 
Composición del gas lacrimógeno
Composición del gas lacrimógenoComposición del gas lacrimógeno
Composición del gas lacrimógeno
 

Similar to Tp cms-g1-v4

Am I reading GC logs Correctly?
Am I reading GC logs Correctly?Am I reading GC logs Correctly?
Am I reading GC logs Correctly?
Tier1 App
 
Low latency & mechanical sympathy issues and solutions
Low latency & mechanical sympathy  issues and solutionsLow latency & mechanical sympathy  issues and solutions
Low latency & mechanical sympathy issues and solutions
Jean-Philippe BEMPEL
 

Similar to Tp cms-g1-v4 (20)

Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
 
Hotspot gc
Hotspot gcHotspot gc
Hotspot gc
 
Glusterfs geo-replication
Glusterfs geo-replicationGlusterfs geo-replication
Glusterfs geo-replication
 
Am I reading GC logs Correctly?
Am I reading GC logs Correctly?Am I reading GC logs Correctly?
Am I reading GC logs Correctly?
 
Geo-Replication and Disaster Recovery : Glusterfs
Geo-Replication and Disaster Recovery : GlusterfsGeo-Replication and Disaster Recovery : Glusterfs
Geo-Replication and Disaster Recovery : Glusterfs
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptx
 
Pick diamonds from garbage
Pick diamonds from garbagePick diamonds from garbage
Pick diamonds from garbage
 
Le guide de dépannage de la jvm
Le guide de dépannage de la jvmLe guide de dépannage de la jvm
Le guide de dépannage de la jvm
 
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
Taming GC Pauses for Humongous Java Heaps in Spark Graph Computing-(Eric Kacz...
 
Google Cloud Platform Special Training
Google Cloud Platform Special TrainingGoogle Cloud Platform Special Training
Google Cloud Platform Special Training
 
GC Tuning & Troubleshooting Crash Course
GC Tuning & Troubleshooting Crash CourseGC Tuning & Troubleshooting Crash Course
GC Tuning & Troubleshooting Crash Course
 
Become a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo ConferenceBecome a Java GC Hero - ConFoo Conference
Become a Java GC Hero - ConFoo Conference
 
Debugging 2013- Sune Vuorela
Debugging 2013- Sune VuorelaDebugging 2013- Sune Vuorela
Debugging 2013- Sune Vuorela
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
 
Low latency & mechanical sympathy issues and solutions
Low latency & mechanical sympathy  issues and solutionsLow latency & mechanical sympathy  issues and solutions
Low latency & mechanical sympathy issues and solutions
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
MAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISESMAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISES
 
Speedrunning the Open Street Map osm2pgsql Loader
Speedrunning the Open Street Map osm2pgsql LoaderSpeedrunning the Open Street Map osm2pgsql Loader
Speedrunning the Open Street Map osm2pgsql Loader
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Tp cms-g1-v4

  • 1. W-JAX 6. November 2013 Memory Management: TP, CMS und G1 Welche GC-Strategie ist die richtige? Tobias@Frech.info / @TobiasFrech
  • 3. iJUG e.V. Interessenverbund der Java User Groups e.V. http://www.ijug.eu/ @iJUGeV ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● © Tobias@Frech.info W-JAX 6. November 2013 ● BED-Con e.V. DOAG e.V. JUG Augsburg JUG Bremen JUG Darmstadt JUG Deutschland e.V. JUG Erlangen–Nürnberg JUG Hannover JUG Karlsruhe JUG Köln JUG München JUG Münster JUG Ostfalen JUG Saxony JUG Stuttgart e.V. JSUG SOUG e.V. SUG Deutschland e.V. 3
  • 4. Objekte oder Garbage? © Tobias@Frech.info W-JAX 6. November 2013 4
  • 6. GC Optimierung ● Objekte nach der Lebensdauer sortiert: ● Einführung von Generationen: wenige wenige langlebige Objekte langlebige Objekte Tenured Tenured Generation Generation Heap (-Xmx...) sehr viele sehr viele kurzlebige Objekte kurzlebige Objekte © Tobias@Frech.info Survior Survior Young Young Generation Generation W-JAX 6. November 2013 6
  • 7. GC Logging ● GC-Logs ausgeben: ● ● GC-Logs nicht überschreiben: ● ● -XX:+PrintGC und -XX:+PrintGCDetails -Xloggc:gc.log_`date +%F_%T` Für die Menschen unter uns: ● ● ● -XX:-PrintGCTimeStamps -XX:+PrintGCDateStamps Für die Admins: ● -XX:+UseGCLogFileRotation ● -XX:GCLogFileSize=, -XX:NumberOfGCLogFiles= © Tobias@Frech.info W-JAX 6. November 2013 7
  • 8. Throughput – GC - Log (201828s = 2 Tage 8 Stunden 3 Minuten 48 Sekunden) 201828.280: [GC [PSYoungGen: 1816941K->29609K(4072576K)] 3126522K->1400938K(12461184K), 0.2465840 secs] [Times: user=0.44 sys=0.00, real=0.24 secs] 201828.527: [Full GC (System) [PSYoungGen: 29609K->0K(4072576K)] [ParOldGen: 1371329K->1154377K(8388608K)] 1400938K->1154377K(12461184K) [PSPermGen: 181489K->181449K(182528K)], 3.3035730 secs] [Times: user=5.98 sys=0.00, real=3.31 secs] © Tobias@Frech.info W-JAX 6. November 2013 8
  • 10. TP - Ergonomics – GC - Log 0,187: [GC [PSYoungGen: 3072K->496K(3584K)] 3072K>508K(9088K), 0,0020340 secs] [Times: user=0,00 sys=0,00, real=0,00 secs] 1,481: [GC [PSYoungGen: 9168K->400K(9856K)] 11059K>2467K(15360K), 0,0022780 secs] [Times: user=0,00 sys=0,00, real=0,00 secs] 2,747: [Full GC [PSYoungGen: 352K->0K(9472K)] [ParOldGen: 5106K>4316K(9408K)] 5458K->4316K(18880K) [PSPermGen: 1981K>1980K(16384K)], 0,0361440 secs] [Times: user=0,05 sys=0,00, real=0,03 secs] 5,839: [Full GC [PSYoungGen: 336K->0K(9984K)] [ParOldGen: 9133K>8668K(15936K)] 9469K->8668K(25920K) [PSPermGen: 1980K>1980K(16384K)], 0,0718830 secs] [Times: user=0,10 sys=0,00, real=0,07 secs] 9,457: [Full GC [PSYoungGen: 352K->0K(9152K)] [ParOldGen: 16003K->13835K(21888K)] 16355K->13835K(31040K) [PSPermGen: 1980K->1980K(16384K)], 0,0782570 secs] [Times: user=0,10 sys=0,00, real=0,07 secs] © Tobias@Frech.info W-JAX 6. November 2013 10
  • 11. Performance und GC ● Unterschiedliche Zielsetzungen ● ● ● Durchsatz Antwortzeit Strategien für die GC auswählen ● falsche Strategie kann verheerende Auswirkungen auf die SLA haben © Tobias@Frech.info W-JAX 6. November 2013 11
  • 12. Multicore, Parallelisierung Serial Parallel -XX:+UseParallelGC / -XX:+UseParallelOldGC © Tobias@Frech.info W-JAX 6. November 2013 12
  • 14. Concurrent Mark and Sweep -XX:+UseConcMarkSweepGC © Tobias@Frech.info W-JAX 6. November 2013 14
  • 15. CMS GC – Log I 108238.954: [GC 108238.954: [ParNew: 1561405K>38199K(2831168K), 0.1625150 secs] 2210735K>687532K(12268352K), 0.1628820 secs] [Times: user=0.30 sys=0.00, real=0.16 secs] 108239.124: [GC [1 CMS-initial-mark: 649332K(9437184K)] 687558K(12268352K), 0.0279780 secs] [Times: user=0.02 sys=0.00, real=0.03 secs] 108239.152: [CMS-concurrent-mark-start] 108240.555: [CMS-concurrent-mark: 1.403/1.403 secs] [Times: user=1.40 sys=0.00, real=1.40 secs] 108240.555: [CMS-concurrent-preclean-start] 108240.600: [CMS-concurrent-preclean: 0.045/0.045 secs] [Times: user=0.04 sys=0.00, real=0.04 secs] © Tobias@Frech.info W-JAX 6. November 2013 15
  • 16. CMS GC – Log II 108240.600: [CMS-concurrent-abortable-preclean-start] CMS: abort preclean due to time 108245.863: [CMS-concurrent-abortable-preclean: 3.937/5.263 secs] [Times: user=3.84 sys=0.00, real=5.26 secs] 108245.865: [GC[YG occupancy: 61713 K (2831168 K)]108245.865: [Rescan (parallel) , 0.0785890 secs]108245.943: [weak refs processing, 0.0000770 secs]108245.944: [scrub string table, 0.0039600 secs] [1 CMS-remark: 649332K(9437184K)] 711045K(12268352K), 0.0828430 secs] [Times: user=0.07 sys=0.00, real=0.08 secs] 108245.948: [CMS-concurrent-sweep-start] 108246.333: [CMS-concurrent-sweep: 0.385/0.385 secs] [Times: user=0.38 sys=0.00, real=0.38 secs] 108246.334: [CMS-concurrent-reset-start] 108246.365: [CMS-concurrent-reset: 0.032/0.032 secs] [Times: user=0.04 sys=0.00, real=0.04 secs] © Tobias@Frech.info W-JAX 6. November 2013 16
  • 17. Situation bisher ● Throughput Collector (TP) ● ● selbst-tunend ● ● optimiert auf Durchsatz De-Fragmentierung zuschaltbar / neuer Default Concurrent Mark and Sweep (CMS) ● optimiert auf Antwortzeit ● De-Fragmentierung nur in STW-Full-GCs ● Heuristik spielt entscheidende Rolle ● Tuning von Hand notwendig © Tobias@Frech.info W-JAX 6. November 2013 17
  • 18. Garbage First ● Wunschliste: ● kurze Pausenzeiten ● vorhersagbares Verhalten ● De-Fragmentierung ● massiv skalierbar (Multicore) ● kein Tuning notwendig ● große Heapgrößen unterstützt © Tobias@Frech.info W-JAX 6. November 2013 18
  • 19. Garbage First G1 - Theorie ● Feste Einteilung des Speichers in Regions ● ● ● ● min. 1 MB Ziel ca. 2000 Regions Auswahl der „am meisten Erfolg versprechenden“ Regions für GC-Lauf Aufräumen: ● Evakuierung der noch lebenden Objekte („Evacuation Pause“) ● leere Region ist dann wieder verfügbar ● Collection Set (CSet) © Tobias@Frech.info W-JAX 6. November 2013 19
  • 20. Garbage First ● 1MB Regions -XX:+UseG1GC © Tobias@Frech.info W-JAX 6. November 2013 20
  • 21. Garbage First - Praxis ● Young-, Survior- und Old-Regions ● Concurrent Marking und Evacuation Pauses ● Vorteil gegenüber CMS: ● ● Ziel: kein Tuning notwendig ● ● Defragmentierung Ziel: STW-Phase mit festgelegter Dauer Full-GC wenn Speicher nicht mehr ausreicht ● bisher keine Parallelisierung! © Tobias@Frech.info W-JAX 6. November 2013 21
  • 22. G1 GC – Log: Evacuation 222515.738: [GC pause (young), 0.38581200 secs] [Parallel Time: 370.2 ms] [GC Worker Start (ms): 222515738.3 222515738.4 Avg: 222515738.4, Min: 222515738.3, Max: 222515738.4, Diff: 0.0] [Ext Root Scanning (ms): 43.2 43.1 Avg: 43.2, Min: 43.1, Max: 43.2, Diff: 0.1] [Update RS (ms): 7.2 8.7 Avg: 8.0, Min: 7.2, Max: 8.7, Diff: 1.4] [Processed Buffers : 80 69 Sum: 149, Avg: 74, Min: 69, Max: 80, Diff: 11] [Scan RS (ms): 17.0 17.0 Avg: 17.0, Min: 17.0, Max: 17.0, Diff: 0.0] [Object Copy (ms): 297.0 295.6 Avg: 296.3, Min: 295.6, Max: 297.0, Diff: 1.4] [Termination (ms): 0.0 0.0 Avg: 0.0, Min: 0.0, Max: 0.0, Diff: 0.0] [Termination Attempts : 1 1 Sum: 2, Avg: 1, Min: 1, Max: 1, Diff: 0] ... © Tobias@Frech.info W-JAX 6. November 2013 22
  • 23. G1 GC – Log: Evacuation ... [GC Worker End (ms): 222516102.8 222516102.8 Avg: 222516102.8, Min: 222516102.8, Max: 222516102.8, Diff: 0.0] [GC Worker (ms): 364.5 364.5 Avg: 364.5, Min: 364.5, Max: 364.5, Diff: 0.0] [GC Worker Other (ms): 5.8 5.8 Avg: 5.8, Min: 5.8, Max: 5.8, Diff: 0.0] [Clear CT: 0.9 ms] [Other: 14.7 ms] [Choose CSet: 0.1 ms] [Ref Proc: 11.2 ms] [Ref Enq: 0.1 ms] [Free CSet: 2.6 ms] [Eden: 2284M(2284M)->0B(2284M) Survivors: 172M->172M Heap: 7461M(12288M)->5189M(12288M)] [Times: user=0.75 sys=0.00, real=0.38 secs] © Tobias@Frech.info W-JAX 6. November 2013 23
  • 24. G1 GC – Log: Concurrent 222879.431: [GC pause (young) (initial-mark), 0.62468900 secs] ... [Eden: 2272M(2272M)->0B(2272M) Survivors: 184M->184M Heap: 7555M(12288M)->5306M(12288M)] [Times: user=1.19 sys=0.01, real=0.63 secs] 222880.056: [GC concurrent-root-region-scan-start] 222880.560: [GC concurrent-root-region-scan-end, 0.5045520] 222880.560: [GC concurrent-mark-start] 222885.610: [GC concurrent-mark-end, 5.0490610 sec] 222885.611: [GC remark 222885.612: [GC ref-proc, 0.0143660 secs], 0.0829630 secs] [Times: user=0.07 sys=0.00, real=0.07 secs] 222885.699: [GC cleanup 5375M->4924M(12288M), 0.0548790 secs] [Times: user=0.07 sys=0.00, real=0.05 secs] 222885.754: [GC concurrent-cleanup-start] 222885.755: [GC concurrent-cleanup-end, 0.0008480] © Tobias@Frech.info W-JAX 6. November 2013 24
  • 25. G1 GC – Log: Evacuation 223007.294: [GC pause (mixed), 0.37419100 secs] [Parallel Time: 350.0 ms] ... [GC Worker End (ms): 223007638.5 223007638.5 Avg: 223007638.5, Min: 223007638.5, Max: 223007638.5, Diff: 0.0] [GC Worker (ms): 342.6 342.6 Avg: 342.6, Min: 342.6, Max: 342.6, Diff: 0.0] [GC Worker Other (ms): 7.4 7.5 Avg: 7.4, Min: 7.4, Max: 7.5, Diff: 0.0] [Clear CT: 1.3 ms] [Other: 22.9 ms] [Choose CSet: 1.9 ms] [Ref Proc: 15.1 ms] [Ref Enq: 0.1 ms] [Free CSet: 5.0 ms] [Eden: 2316M(2316M)->0B(2300M) Survivors: 140M->156M Heap: 7160M(12288M)->3988M(12288M)] [Times: user=0.71 sys=0.00, real=0.37 secs] Details unter https://blogs.oracle.com/poonam/ © Tobias@Frech.info W-JAX 6. November 2013 25
  • 26. GC im Lasttest ● Lasttest mit rein interaktiver (HTTP) Last ● Linux-VM mit 12GB RAM, 6 VCPU ● JVM mit -Xmx8g ● Testläufe: ● ● JDK 7 Update 7, TP-Collector ● ● JDK 6 Update 31, TP-Collector JDK 7 Update 7, G1-Collector (-XX:+UseG1GC) Aufbereitung der „jstat -gc“-Ausgabe mit 10Sekunden-Intervall © Tobias@Frech.info W-JAX 6. November 2013 26
  • 27. JDK 6, TP-Collector © Tobias@Frech.info W-JAX 6. November 2013 27
  • 28. JDK 7, TP-Collector © Tobias@Frech.info W-JAX 6. November 2013 28
  • 29. JDK 7, G1-Collector © Tobias@Frech.info W-JAX 6. November 2013 29
  • 30. Vergleich TP / CMS / G1 ● Produktivsystem ● ● ● 4 VMs kein Speichermangel Auswertung des GC-Log (-XX:+PrintGCDetails) © Tobias@Frech.info W-JAX 6. November 2013 30
  • 31. TP – GC in Produktion 12 10 8 6 4 2 0 0 50000 © Tobias@Frech.info 100000 150000 200000 W-JAX 6. November 2013 250000 300000 350000 31
  • 32. CMS – GC in Produktion 1,4 1,2 1 0,8 0,6 0,4 0,2 0 0 50000 © Tobias@Frech.info 100000 150000 200000 W-JAX 6. November 2013 250000 300000 350000 32
  • 33. G1 – GC in Produktion 4 3,5 3 2,5 2 1,5 1 0,5 0 0 50000 © Tobias@Frech.info 100000 150000 200000 W-JAX 6. November 2013 250000 300000 350000 33
  • 34. G1 Switches ● Alle JVM-Switches ausgeben: java -XX:+UnlockDiagnosticVMOptions -XX: +PrintFlagsFinal -version ● G1-Ergonomics-Entscheidungen ausgeben: -XX:+PrintAdaptiveSizePolicy ● Zielvorgabe für Pausen: -XX:MaxGCPauseMillis=200 © Tobias@Frech.info W-JAX 6. November 2013 34
  • 35. GC - Entscheidung ● „Don't try to fix me, I'm not broken“ (Evanescence) ● Wirksamkeit von Optimierungen sicherstellen ● Messen notwendig (besser als Bauchgefühl) Throughput-Collector STW-Phasen zu lang? nein :-) G1-Collector STW-Phasen zu lang? nein CMS-Collector © Tobias@Frech.info CMS-Tuning W-JAX 6. November 2013 35
  • 36. Ressourcen ● VisualVM Plugin „GC Viewer“ ● ● Artikel JVM-Tools ● ● http://java.dzone.com/articles/visualvm-gcviewer-plugin http://frech.info/meins/Tobias_Frech_2010_Java_aktuell_1.pdf Tools für Log-Files: ● ● ● GCViewer: https://github.com/chewiebug/GCViewer GCHisto: http://java.net/projects/gchisto Dokumentation: ● GC Whitepaper: http://www.oracle.com/technetwork/java/javase/memorymanagement-whitepaper-150215.pdf ● G1-Tuning: https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=6583 http://www.slideshare.net/MonicaBeckwith/garbage-first-garbage-collector-g1-gc-migration-to-expectations-and-advanced-tu ning © Tobias@Frech.info W-JAX 6. November 2013 36
  • 37. Vielen Dank! follow me @TobiasFrech W-JAX 6. November 2013 © Tobias@Frech.info CC BY-SA 2.0 Richard Slessor 37