SlideShare a Scribd company logo
#DevoxxFR
Le guide de dépannage de la
JVM
Jean-Philippe BEMPEL @jpbempel
Architecte Performance – Ullink
jpbempel@ullink.com
http://jpbempel.blogpost.com
1
#DevoxxFR
1
#DevoxxFR
Agenda
2
●
Options de démarrage de la JVM
●
CPU/Threads
●
Mémoire/GC
●
Crashs JVM
#DevoxxFR
Options de démarrage
3
http://analyzethiz.fr/contenu/uploads/2012/04/Duke_Wave.png
#DevoxxFR
Les options de la JVM
●
Démarrer la JVM avec des options
●
Des tonnes d'options disponibles (~720-860)
-XX:+PrintFlagsFinal
●
Utiles pour la configuration, le diagnostique et le tuning
●
La plupart des options sont seulment modifiables au
démarrage
4
#DevoxxFR
jinfo
●
Outil inclus dans le JDK
●
Fournis des informations de configuration d'une instance
de JVM
–Propriétés système
–Options JVM
–Ligne de commande
●
L'outil jcmd peut aussi être utilisé
5
#DevoxxFR
Options modifiables
●
Certaines options sont modifiables à chaud
java -XX:+PrintFlagsFinal -version | grep
manageable
● jinfo -flag +PrintGCDetails <pid>
●
JMX MBean
com.sun.management.HotSpotDiagnostic
setVMOption
6
#DevoxxFR
Live Demo
7
#DevoxxFR
CPU/Threads
8
https://duke.kenai.com/IPG/Duke_Thread.gif
#DevoxxFR
Thread dump
●
JVM bloquée ou CPU à 100% => prenez un Thread dump
● jstack <pid>
● kill -3 <pid>
(sortie dans stdout de la JVM !)
● jcmd <pid> Thread.print
9
#DevoxxFR
Thread dump
"Thread-5" #61 prio=5 os_prio=0 tid=0x00007f5d19a69800 nid=0x262c runnable
[0x00007f5bbf6fd000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000713cc35c8> (a sun.nio.ch.Util$2)
- locked <0x0000000713cc35e0> (a
java.util.Collections$UnmodifiableSet)
- locked <0x0000000712711f68> (a sun.nio.ch.EPollSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:352)
at java.lang.Thread.run(Thread.java:745)
10
1 2 3
4
#DevoxxFR
Deadlocks
●
Thread dumps peuvent automatiquement détecter des
deadlocks
●
Fonctionne pour les blocks synchronized et j.u.c.Lock
●
Peut être appelé par JMX
java.lang.Threading findDeadlockedThreads
11
#DevoxxFR
Deadlocks
Found one Java-level deadlock:
=============================
"Thread-0":
waiting for ownable synchronizer 0x000000076b2f0fc8, (a
java.util.concurrent.locks.ReentrantLock$NonfairSync),
which is held by "main"
"main":
waiting for ownable synchronizer 0x000000076b2f0ff8, (a
java.util.concurrent.locks.ReentrantLock$NonfairSync),
which is held by "Thread-0"
12
#DevoxxFR
Live Demo
13
#DevoxxFR
Mémoire/GC
14http://384uqqh5pka2ma24ild282mv.wpengine.netdna-
cdn.com/wp-content/uploads/2015/04/GCDuke.png
#DevoxxFR
Tools In Action
15
#DevoxxFR
Logs GC
Options JVM minimales:
– -Xloggc:gc.log
– -XX:+PrintGCDetails
– -XX:+PrintGCDateStamps
2017-02-08T11:33:24.740+0100: 656.316: [Full GC
(System.gc()) [PSYoungGen: 60359K->0K(458752K)]
[ParOldGen: 917600K->976339K(3670016K)] 977960K-
>976339K(4128768K), [Metaspace: 47136K-
>44073K(106496K)], 0.2618394 secs] [Times:
user=1.04 sys=0.03, real=0.26 secs]
15
#DevoxxFR
Graphez !
16
#DevoxxFR
Logs GC
[Times: user=1.17 sys=0.07, real=0.11 secs]
[Times: user=200.96 sys=85.32, real=60.68 secs]
[Times: user=2.58 sys=0.00, real=49.34 secs]
17
#DevoxxFR
Logs GC
●
Informations sur les Survivors
-XX:+PrintTenuringDistribution
●
Temps des Safepoints
-XX:+PrintGCApplicationStoppedTime
2017-02-10T15:56:20.581+0100: 851.548: Total time for
which application threads were stopped: 0.3539306
seconds, Stopping threads took: 0.0000169 seconds
●
Détails sur les Safepoints
-XX:+PrintSafepointStatistics
-XX:PrintSafepointStatisticsCount=1
18
#DevoxxFR
Logs GC JDK9
-Xlog:gc*:file=gclog.txt:time:uptime,l,tg:
[2016-05-20T11:17:44.887+0200][0.038s][info][gc] Using Parallel
[2016-05-20T11:17:44.887+0200][0.038s][info][gc,heap,coops] Heap address: 0x00000006fc000000, size: 4096
MB, Compressed Oops mode: Zero based, Oop shift amount: 3
[2016-05-20T11:17:47.291+0200][2.441s][info][gc,start ] GC(0) Pause Young (Allocation Failure)
(2.441s)
[2016-05-20T11:17:47.321+0200][2.471s][info][gc,heap ] GC(0) PSYoungGen: 393216K->29472K(458752K)
[2016-05-20T11:17:47.321+0200][2.471s][info][gc,heap ] GC(0) ParOldGen: 0K->8K(3670016K)
[2016-05-20T11:17:47.321+0200][2.471s][info][gc,metaspace ] GC(0) Metaspace: 18073K->18073K(81920K)
[2016-05-20T11:17:47.321+0200][2.471s][info][gc ] GC(0) Pause Young (Allocation Failure) 384M-
>28M(4032M) (2.441s, 2.471s) 29.691ms
[2016-05-20T11:17:47.321+0200][2.471s][info][gc,cpu ] GC(0) User=0.12s Sys=0.00s Real=0.03s
[2016-05-20T11:17:50.817+0200][5.969s][info][gc,start ] GC(1) Pause Young (Allocation Failure)
(5.969s)
[2016-05-20T11:17:50.847+0200][5.994s][info][gc,heap ] GC(1) PSYoungGen: 422688K->45128K(458752K)
[2016-05-20T11:17:50.847+0200][5.994s][info][gc,heap ] GC(1) ParOldGen: 917512K->917520K(3670016K)
[2016-05-20T11:17:50.847+0200][5.994s][info][gc,metaspace ] GC(1) Metaspace: 28613K->28613K(92160K)
[2016-05-20T11:17:50.847+0200][5.994s][info][gc ] GC(1) Pause Young (Allocation Failure)
1308M->940M(4032M) (5.969s, 5.994s) 24.988ms
[2016-05-20T11:17:50.847+0200][5.994s][info][gc,cpu ] GC(1) User=0.12s Sys=0.00s Real=0.03s
19
#DevoxxFR
JMX/MBean
●
MBean:
java.lang:type=GarbageCollector,name=*
name dépend du type de GC
●
Permet un monitoring interne ou externe + Notifications
●
LastGCInfo
–Nombre de threads
–Durée
–Utilisation mémoire avant/après
–Heure de démarrage/fin
20
#DevoxxFR
Fuite / OutOfMemoryError
●
Problème de mémoire => Prendre un Histogramme
●
Attention ! C'est un événément STW (genre FullGC !)
● jmap -histo[:live] <pid>
● -XX:+PrintHistogramBeforeFullGC
21
#DevoxxFR
Analyse d'un histogramme
num #instances #bytes class name
----------------------------------------------
1: 421751083 20244051984 java.util.concurrent.ConcurrentHashMap$HashEntry
2: 23327688 12130397760 com.ullink.ulmonitoring.api.model.SimpleBMOrder
3: 23428922 6694953456 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
4: 11574497 5007170576 [C
5: 178973 2246627208 [B
6: 23357783 1681760376 java.util.concurrent.ConcurrentHashMap
7: 26115162 1253527776 java.util.HashMap$Entry
8: 23386843 1122568464 java.util.concurrent.locks.ReentrantLock$NonfairSync
9: 23381591 1122316368 java.util.concurrent.ConcurrentHashMap$Segment
10: 27363594 1094543760 java.lang.String
11: 22350856 894034240 com.ullink.ulmonitoring.api.model.IndentedHelper
12: 22350849 894033960 com.ullink.ulmonitoring.api.model.OrderLine
13: 23357784 747639528 [Ljava.util.concurrent.ConcurrentHashMap$Segment;
14: 22350792 715225344 com.ullink.ulmonitoring.view.HierarchicalOrderLine
15: 23356168 560548032 com.ullink.ulmonitoring.api.model.property.PropertyHolderImpl
...
817: 40 4480 com.ullink.ulmonitoring.view.HierarchicalViewDataContainer
22
#DevoxxFR
Fuite / OutOfMemoryError
●
Toujours un problème => Prendre un heap dump
●
Attention ! C'est un événément STW très très long !
● jmap -dump:[live,]format=b,file=heap.hprof <pid>
● -XX:+HeapDumpOnOutOfMemory
-XX:HeapDumpPath=../logs
-XX:OnOutOfMemoryError=sh OOME_script.sh
●
JMX: com.sun.management:type=HotSpotDiagnostic
dumpHeap(filen liveonly)
23
#DevoxxFR
Fuite / OutOfMemoryError
24
#DevoxxFR
Crashs JVM
25http://rl337.org/wp-content/uploads/2012/07/drunk-duke.png
#DevoxxFR
Crash
●
Normalement crashs sont intercéptés et un fichier
hs_err_pis<pid>.log est créé dans le répertoire de
travail
● -XX:ErrorFile=/tmp/hs_err_pid%p.log
-XX:OnError=sh crash_script.sh
●
Normalement un bug de la JVM
=> Un programme Java ne devrait jamais planté une JVM
●
Utilisez toujours la dernière mise à jour du JDK
26
#DevoxxFR
References
●
FastThread.io Web Thread dump analyzer
●
GCEasy.io Web GC analyzer
●
GC Causes distilled
27
#DevoxxFR
Merci !
Jean-Philippe BEMPEL @jpbempel
Architecte Performance – Ullink
jpbempel@ullink.com
http://jpbempel.blogpost.com
28

More Related Content

What's hot

Kgdb kdb modesetting
Kgdb kdb modesettingKgdb kdb modesetting
Kgdb kdb modesetting
Kaushal Kumar Gupta
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
Viller Hsiao
 
Varnish Web Accelerator
Varnish Web AcceleratorVarnish Web Accelerator
Varnish Web AcceleratorRahul Ghose
 
MySQL Galera 集群
MySQL Galera 集群MySQL Galera 集群
MySQL Galera 集群
YUCHENG HU
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
kawamuray
 
Gc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxGc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxCuong Tran
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writerEnkitec
 
Metrics with Ganglia
Metrics with GangliaMetrics with Ganglia
Metrics with Ganglia
Gareth Rushgrove
 
Ganglia monitoring
Ganglia monitoringGanglia monitoring
Ganglia monitoring
Chen Robert
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten Replicator
Giuseppe Maxia
 
Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置
YUCHENG HU
 
Ganglia Monitoring Tool
Ganglia Monitoring ToolGanglia Monitoring Tool
Ganglia Monitoring Tool
sudhirpg
 
OOW 2013: Where did my CPU go
OOW 2013: Where did my CPU goOOW 2013: Where did my CPU go
OOW 2013: Where did my CPU goKristofferson A
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
Alexey Lesovsky
 
Iptables
IptablesIptables
Iptables
rohit verma
 
Tacc Infinite Memory Engine
Tacc Infinite Memory EngineTacc Infinite Memory Engine
Tacc Infinite Memory Engine
inside-BigData.com
 
Percona XtraDB 集群内部
Percona XtraDB 集群内部Percona XtraDB 集群内部
Percona XtraDB 集群内部
YUCHENG HU
 
BKK16-TR08 How to generate power models for EAS and IPA
BKK16-TR08 How to generate power models for EAS and IPABKK16-TR08 How to generate power models for EAS and IPA
BKK16-TR08 How to generate power models for EAS and IPA
Linaro
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)
Brendan Gregg
 
ATO Linux Performance 2018
ATO Linux Performance 2018ATO Linux Performance 2018
ATO Linux Performance 2018
Brendan Gregg
 

What's hot (20)

Kgdb kdb modesetting
Kgdb kdb modesettingKgdb kdb modesetting
Kgdb kdb modesetting
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
 
Varnish Web Accelerator
Varnish Web AcceleratorVarnish Web Accelerator
Varnish Web Accelerator
 
MySQL Galera 集群
MySQL Galera 集群MySQL Galera 集群
MySQL Galera 集群
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
 
Gc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linuxGc and-pagescan-attacks-by-linux
Gc and-pagescan-attacks-by-linux
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Metrics with Ganglia
Metrics with GangliaMetrics with Ganglia
Metrics with Ganglia
 
Ganglia monitoring
Ganglia monitoringGanglia monitoring
Ganglia monitoring
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten Replicator
 
Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置
 
Ganglia Monitoring Tool
Ganglia Monitoring ToolGanglia Monitoring Tool
Ganglia Monitoring Tool
 
OOW 2013: Where did my CPU go
OOW 2013: Where did my CPU goOOW 2013: Where did my CPU go
OOW 2013: Where did my CPU go
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
 
Iptables
IptablesIptables
Iptables
 
Tacc Infinite Memory Engine
Tacc Infinite Memory EngineTacc Infinite Memory Engine
Tacc Infinite Memory Engine
 
Percona XtraDB 集群内部
Percona XtraDB 集群内部Percona XtraDB 集群内部
Percona XtraDB 集群内部
 
BKK16-TR08 How to generate power models for EAS and IPA
BKK16-TR08 How to generate power models for EAS and IPABKK16-TR08 How to generate power models for EAS and IPA
BKK16-TR08 How to generate power models for EAS and IPA
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)
 
ATO Linux Performance 2018
ATO Linux Performance 2018ATO Linux Performance 2018
ATO Linux Performance 2018
 

Similar to Le guide de dépannage de la jvm

Top-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app
 
Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
Tier1app
 
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...
Spark Summit
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
Brendan Gregg
 
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTigerLet the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Jon Rangel
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
Ivan Babrou
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
libfetion
 
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
Poonam Bajaj Parhar
 
Tp cms-g1-v4
Tp cms-g1-v4Tp cms-g1-v4
Tp cms-g1-v4
Tobias Frech
 
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
GregSmith458515
 
Moving to G1GC
Moving to G1GCMoving to G1GC
Moving to G1GC
Kirk Pepperdine
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Ontico
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
Bobby Curtis
 
MAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISESMAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISES
Tier1 app
 
Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
Takahiro YAMADA
 
Reproducible Computational Pipelines with Docker and Nextflow
Reproducible Computational Pipelines with Docker and NextflowReproducible Computational Pipelines with Docker and Nextflow
Reproducible Computational Pipelines with Docker and Nextflow
inside-BigData.com
 
Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9
Poonam Bajaj Parhar
 

Similar to Le guide de dépannage de la jvm (20)

Top-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
 
Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
 
Jud con presentation_brazil
Jud con presentation_brazilJud con presentation_brazil
Jud con presentation_brazil
 
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...
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
 
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTigerLet the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
Tp cms-g1-v4
Tp cms-g1-v4Tp cms-g1-v4
Tp cms-g1-v4
 
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
 
Moving to G1GC
Moving to G1GCMoving to G1GC
Moving to G1GC
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 
MAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISESMAJOR OUTAGES IN MAJOR ENTERPRISES
MAJOR OUTAGES IN MAJOR ENTERPRISES
 
Oracle on AWS RDS Migration - 성기명
Oracle on AWS RDS Migration - 성기명Oracle on AWS RDS Migration - 성기명
Oracle on AWS RDS Migration - 성기명
 
Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
 
Reproducible Computational Pipelines with Docker and Nextflow
Reproducible Computational Pipelines with Docker and NextflowReproducible Computational Pipelines with Docker and Nextflow
Reproducible Computational Pipelines with Docker and Nextflow
 
Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9
 

More from Jean-Philippe BEMPEL

Mastering GC.pdf
Mastering GC.pdfMastering GC.pdf
Mastering GC.pdf
Jean-Philippe BEMPEL
 
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
Jean-Philippe BEMPEL
 
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
Jean-Philippe BEMPEL
 
Tools in action jdk mission control and flight recorder
Tools in action  jdk mission control and flight recorderTools in action  jdk mission control and flight recorder
Tools in action jdk mission control and flight recorder
Jean-Philippe BEMPEL
 
Understanding JVM GC: advanced!
Understanding JVM GC: advanced!Understanding JVM GC: advanced!
Understanding JVM GC: advanced!
Jean-Philippe BEMPEL
 
Understanding low latency jvm gcs V2
Understanding low latency jvm gcs V2Understanding low latency jvm gcs V2
Understanding low latency jvm gcs V2
Jean-Philippe BEMPEL
 
Understanding low latency jvm gcs
Understanding low latency jvm gcsUnderstanding low latency jvm gcs
Understanding low latency jvm gcs
Jean-Philippe BEMPEL
 
Understanding jvm gc advanced
Understanding jvm gc advancedUnderstanding jvm gc advanced
Understanding jvm gc advanced
Jean-Philippe BEMPEL
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differences
Jean-Philippe BEMPEL
 
Out ofmemoryerror what is the cost of java objects
Out ofmemoryerror  what is the cost of java objectsOut ofmemoryerror  what is the cost of java objects
Out ofmemoryerror what is the cost of java objects
Jean-Philippe BEMPEL
 
OutOfMemoryError : quel est le coût des objets en java
OutOfMemoryError : quel est le coût des objets en javaOutOfMemoryError : quel est le coût des objets en java
OutOfMemoryError : quel est le coût des objets en java
Jean-Philippe BEMPEL
 
Lock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx ukLock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx uk
Jean-Philippe BEMPEL
 
Lock free programming- pro tips
Lock free programming- pro tipsLock free programming- pro tips
Lock free programming- pro tips
Jean-Philippe BEMPEL
 
Programmation lock free - les techniques des pros (2eme partie)
Programmation lock free - les techniques des pros (2eme partie)Programmation lock free - les techniques des pros (2eme partie)
Programmation lock free - les techniques des pros (2eme partie)
Jean-Philippe BEMPEL
 
Programmation lock free - les techniques des pros (1ere partie)
Programmation lock free - les techniques des pros (1ere partie)Programmation lock free - les techniques des pros (1ere partie)
Programmation lock free - les techniques des pros (1ere partie)
Jean-Philippe BEMPEL
 
Measuring directly from cpu hardware performance counters
Measuring directly from cpu  hardware performance countersMeasuring directly from cpu  hardware performance counters
Measuring directly from cpu hardware performance counters
Jean-Philippe BEMPEL
 
Devoxx france 2014 compteurs de perf
Devoxx france 2014 compteurs de perfDevoxx france 2014 compteurs de perf
Devoxx france 2014 compteurs de perf
Jean-Philippe BEMPEL
 

More from Jean-Philippe BEMPEL (17)

Mastering GC.pdf
Mastering GC.pdfMastering GC.pdf
Mastering GC.pdf
 
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
Javaday 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneur...
 
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
Devoxx Fr 2022 - Remèdes aux oomkill, warm-ups, et lenteurs pour des conteneu...
 
Tools in action jdk mission control and flight recorder
Tools in action  jdk mission control and flight recorderTools in action  jdk mission control and flight recorder
Tools in action jdk mission control and flight recorder
 
Understanding JVM GC: advanced!
Understanding JVM GC: advanced!Understanding JVM GC: advanced!
Understanding JVM GC: advanced!
 
Understanding low latency jvm gcs V2
Understanding low latency jvm gcs V2Understanding low latency jvm gcs V2
Understanding low latency jvm gcs V2
 
Understanding low latency jvm gcs
Understanding low latency jvm gcsUnderstanding low latency jvm gcs
Understanding low latency jvm gcs
 
Understanding jvm gc advanced
Understanding jvm gc advancedUnderstanding jvm gc advanced
Understanding jvm gc advanced
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differences
 
Out ofmemoryerror what is the cost of java objects
Out ofmemoryerror  what is the cost of java objectsOut ofmemoryerror  what is the cost of java objects
Out ofmemoryerror what is the cost of java objects
 
OutOfMemoryError : quel est le coût des objets en java
OutOfMemoryError : quel est le coût des objets en javaOutOfMemoryError : quel est le coût des objets en java
OutOfMemoryError : quel est le coût des objets en java
 
Lock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx ukLock free programming - pro tips devoxx uk
Lock free programming - pro tips devoxx uk
 
Lock free programming- pro tips
Lock free programming- pro tipsLock free programming- pro tips
Lock free programming- pro tips
 
Programmation lock free - les techniques des pros (2eme partie)
Programmation lock free - les techniques des pros (2eme partie)Programmation lock free - les techniques des pros (2eme partie)
Programmation lock free - les techniques des pros (2eme partie)
 
Programmation lock free - les techniques des pros (1ere partie)
Programmation lock free - les techniques des pros (1ere partie)Programmation lock free - les techniques des pros (1ere partie)
Programmation lock free - les techniques des pros (1ere partie)
 
Measuring directly from cpu hardware performance counters
Measuring directly from cpu  hardware performance countersMeasuring directly from cpu  hardware performance counters
Measuring directly from cpu hardware performance counters
 
Devoxx france 2014 compteurs de perf
Devoxx france 2014 compteurs de perfDevoxx france 2014 compteurs de perf
Devoxx france 2014 compteurs de perf
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

Le guide de dépannage de la jvm

  • 1. #DevoxxFR Le guide de dépannage de la JVM Jean-Philippe BEMPEL @jpbempel Architecte Performance – Ullink jpbempel@ullink.com http://jpbempel.blogpost.com 1
  • 3. #DevoxxFR Agenda 2 ● Options de démarrage de la JVM ● CPU/Threads ● Mémoire/GC ● Crashs JVM
  • 5. #DevoxxFR Les options de la JVM ● Démarrer la JVM avec des options ● Des tonnes d'options disponibles (~720-860) -XX:+PrintFlagsFinal ● Utiles pour la configuration, le diagnostique et le tuning ● La plupart des options sont seulment modifiables au démarrage 4
  • 6. #DevoxxFR jinfo ● Outil inclus dans le JDK ● Fournis des informations de configuration d'une instance de JVM –Propriétés système –Options JVM –Ligne de commande ● L'outil jcmd peut aussi être utilisé 5
  • 7. #DevoxxFR Options modifiables ● Certaines options sont modifiables à chaud java -XX:+PrintFlagsFinal -version | grep manageable ● jinfo -flag +PrintGCDetails <pid> ● JMX MBean com.sun.management.HotSpotDiagnostic setVMOption 6
  • 10. #DevoxxFR Thread dump ● JVM bloquée ou CPU à 100% => prenez un Thread dump ● jstack <pid> ● kill -3 <pid> (sortie dans stdout de la JVM !) ● jcmd <pid> Thread.print 9
  • 11. #DevoxxFR Thread dump "Thread-5" #61 prio=5 os_prio=0 tid=0x00007f5d19a69800 nid=0x262c runnable [0x00007f5bbf6fd000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method) at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269) at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86) - locked <0x0000000713cc35c8> (a sun.nio.ch.Util$2) - locked <0x0000000713cc35e0> (a java.util.Collections$UnmodifiableSet) - locked <0x0000000712711f68> (a sun.nio.ch.EPollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97) at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:352) at java.lang.Thread.run(Thread.java:745) 10 1 2 3 4
  • 12. #DevoxxFR Deadlocks ● Thread dumps peuvent automatiquement détecter des deadlocks ● Fonctionne pour les blocks synchronized et j.u.c.Lock ● Peut être appelé par JMX java.lang.Threading findDeadlockedThreads 11
  • 13. #DevoxxFR Deadlocks Found one Java-level deadlock: ============================= "Thread-0": waiting for ownable synchronizer 0x000000076b2f0fc8, (a java.util.concurrent.locks.ReentrantLock$NonfairSync), which is held by "main" "main": waiting for ownable synchronizer 0x000000076b2f0ff8, (a java.util.concurrent.locks.ReentrantLock$NonfairSync), which is held by "Thread-0" 12
  • 17. #DevoxxFR Logs GC Options JVM minimales: – -Xloggc:gc.log – -XX:+PrintGCDetails – -XX:+PrintGCDateStamps 2017-02-08T11:33:24.740+0100: 656.316: [Full GC (System.gc()) [PSYoungGen: 60359K->0K(458752K)] [ParOldGen: 917600K->976339K(3670016K)] 977960K- >976339K(4128768K), [Metaspace: 47136K- >44073K(106496K)], 0.2618394 secs] [Times: user=1.04 sys=0.03, real=0.26 secs] 15
  • 19. #DevoxxFR Logs GC [Times: user=1.17 sys=0.07, real=0.11 secs] [Times: user=200.96 sys=85.32, real=60.68 secs] [Times: user=2.58 sys=0.00, real=49.34 secs] 17
  • 20. #DevoxxFR Logs GC ● Informations sur les Survivors -XX:+PrintTenuringDistribution ● Temps des Safepoints -XX:+PrintGCApplicationStoppedTime 2017-02-10T15:56:20.581+0100: 851.548: Total time for which application threads were stopped: 0.3539306 seconds, Stopping threads took: 0.0000169 seconds ● Détails sur les Safepoints -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 18
  • 21. #DevoxxFR Logs GC JDK9 -Xlog:gc*:file=gclog.txt:time:uptime,l,tg: [2016-05-20T11:17:44.887+0200][0.038s][info][gc] Using Parallel [2016-05-20T11:17:44.887+0200][0.038s][info][gc,heap,coops] Heap address: 0x00000006fc000000, size: 4096 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 [2016-05-20T11:17:47.291+0200][2.441s][info][gc,start ] GC(0) Pause Young (Allocation Failure) (2.441s) [2016-05-20T11:17:47.321+0200][2.471s][info][gc,heap ] GC(0) PSYoungGen: 393216K->29472K(458752K) [2016-05-20T11:17:47.321+0200][2.471s][info][gc,heap ] GC(0) ParOldGen: 0K->8K(3670016K) [2016-05-20T11:17:47.321+0200][2.471s][info][gc,metaspace ] GC(0) Metaspace: 18073K->18073K(81920K) [2016-05-20T11:17:47.321+0200][2.471s][info][gc ] GC(0) Pause Young (Allocation Failure) 384M- >28M(4032M) (2.441s, 2.471s) 29.691ms [2016-05-20T11:17:47.321+0200][2.471s][info][gc,cpu ] GC(0) User=0.12s Sys=0.00s Real=0.03s [2016-05-20T11:17:50.817+0200][5.969s][info][gc,start ] GC(1) Pause Young (Allocation Failure) (5.969s) [2016-05-20T11:17:50.847+0200][5.994s][info][gc,heap ] GC(1) PSYoungGen: 422688K->45128K(458752K) [2016-05-20T11:17:50.847+0200][5.994s][info][gc,heap ] GC(1) ParOldGen: 917512K->917520K(3670016K) [2016-05-20T11:17:50.847+0200][5.994s][info][gc,metaspace ] GC(1) Metaspace: 28613K->28613K(92160K) [2016-05-20T11:17:50.847+0200][5.994s][info][gc ] GC(1) Pause Young (Allocation Failure) 1308M->940M(4032M) (5.969s, 5.994s) 24.988ms [2016-05-20T11:17:50.847+0200][5.994s][info][gc,cpu ] GC(1) User=0.12s Sys=0.00s Real=0.03s 19
  • 22. #DevoxxFR JMX/MBean ● MBean: java.lang:type=GarbageCollector,name=* name dépend du type de GC ● Permet un monitoring interne ou externe + Notifications ● LastGCInfo –Nombre de threads –Durée –Utilisation mémoire avant/après –Heure de démarrage/fin 20
  • 23. #DevoxxFR Fuite / OutOfMemoryError ● Problème de mémoire => Prendre un Histogramme ● Attention ! C'est un événément STW (genre FullGC !) ● jmap -histo[:live] <pid> ● -XX:+PrintHistogramBeforeFullGC 21
  • 24. #DevoxxFR Analyse d'un histogramme num #instances #bytes class name ---------------------------------------------- 1: 421751083 20244051984 java.util.concurrent.ConcurrentHashMap$HashEntry 2: 23327688 12130397760 com.ullink.ulmonitoring.api.model.SimpleBMOrder 3: 23428922 6694953456 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry; 4: 11574497 5007170576 [C 5: 178973 2246627208 [B 6: 23357783 1681760376 java.util.concurrent.ConcurrentHashMap 7: 26115162 1253527776 java.util.HashMap$Entry 8: 23386843 1122568464 java.util.concurrent.locks.ReentrantLock$NonfairSync 9: 23381591 1122316368 java.util.concurrent.ConcurrentHashMap$Segment 10: 27363594 1094543760 java.lang.String 11: 22350856 894034240 com.ullink.ulmonitoring.api.model.IndentedHelper 12: 22350849 894033960 com.ullink.ulmonitoring.api.model.OrderLine 13: 23357784 747639528 [Ljava.util.concurrent.ConcurrentHashMap$Segment; 14: 22350792 715225344 com.ullink.ulmonitoring.view.HierarchicalOrderLine 15: 23356168 560548032 com.ullink.ulmonitoring.api.model.property.PropertyHolderImpl ... 817: 40 4480 com.ullink.ulmonitoring.view.HierarchicalViewDataContainer 22
  • 25. #DevoxxFR Fuite / OutOfMemoryError ● Toujours un problème => Prendre un heap dump ● Attention ! C'est un événément STW très très long ! ● jmap -dump:[live,]format=b,file=heap.hprof <pid> ● -XX:+HeapDumpOnOutOfMemory -XX:HeapDumpPath=../logs -XX:OnOutOfMemoryError=sh OOME_script.sh ● JMX: com.sun.management:type=HotSpotDiagnostic dumpHeap(filen liveonly) 23
  • 28. #DevoxxFR Crash ● Normalement crashs sont intercéptés et un fichier hs_err_pis<pid>.log est créé dans le répertoire de travail ● -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:OnError=sh crash_script.sh ● Normalement un bug de la JVM => Un programme Java ne devrait jamais planté une JVM ● Utilisez toujours la dernière mise à jour du JDK 26
  • 29. #DevoxxFR References ● FastThread.io Web Thread dump analyzer ● GCEasy.io Web GC analyzer ● GC Causes distilled 27
  • 30. #DevoxxFR Merci ! Jean-Philippe BEMPEL @jpbempel Architecte Performance – Ullink jpbempel@ullink.com http://jpbempel.blogpost.com 28