SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
The Developer Swiss Knife: Troubleshooting
Tools for Java EE Applications
Assumptions
•This presentation aims experienced developers
with a little (but good) knowledge about how the
JVM works
•The presentation focus only on the tools, not on
the troubleshooting methods
•Some of the tools are only for Linux. Windows
users, get out! =P
•All tools presented in this presentation are Open
Source projects and some of them are
developed by JBoss
The Application stack
Our primary focus
The Tools
•JDK CLI Tools (jstack, jmap, jps, etc.)
•JDK GUI Tools (JVisualVM, JConsole)
•Eclipse Memory Analyzer Tool (MAT)
•Thermostat
•Garbagecat
•Samurai
•AS7 JDR (JBoss Disaster Report) tool
•Tattletale
•Byteman*
JDK has its own troubleshooting tools
● jps
● jmap
● jinfo
● jhat
● jstack
Some of them are Graphical
● JConsole
● JVisualVM
What should I do when my application has a
memory problem?
Generating a Heap Dump
● -XX:-HeapDumpOnOutOfMemoryError
● jmap
● JVisualVM
Ok, I have a Heap Dump. Now can I analyze it?
Meet Eclipse MAT
What should I do if my application have a CPU
problem? e.g. High CPU consumption
Generating a Thread Dump
● jstack
● kill -3
● AS7 CLI command:
– /core-service=platform-
mbean/type=threading:dump-all-threads(locked-
monitors=true,locked-synchronizers=true)
Now with a Thread Dump, what should I do with
it?
Samurai – A Thread Dump viewer
High CPU consumption can be high GC activity
Enabling GC Logging
● Add to java command:
-XX:+PrintGC -Xloggc:gc.log -XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
GC Log content
3.122: [GC 132096K->24592K(504320K), 0.0321910 secs]
4.558: [GC 156688K->26752K(504320K), 0.0340520 secs]
6.609: [GC 158848K->50117K(504320K), 0.0628430 secs]
7.077: [GC 80334K->54921K(504320K), 0.0416730 secs]
7.119: [Full GC 54921K->46716K(504320K), 0.2522170 secs]
8.510: [GC 178812K->60924K(504320K), 0.0190690 secs]
9.683: [GC 193020K->69447K(461696K), 0.0308020 secs]
Garbagecat
java -jar garbagecat-1.0.0.jar --help
usage: garbagecat [OPTION]... [FILE]
-h,--help help
-o,--options <arg> JVM options used during JVM run
-p,--preprocess preprocessing flag
-s,--startdatetime <arg> JVM start datetime (yyyy-MM-dd HH:mm:ss,SSS)
for converting GC logging timestamps to datetime
-t,--threshold <arg> threshold (0-100) for throughput bottleneck
reporting
Garbagecat report
========================================
Throughput less than 90% for PARALLEL_SCAVENGE
========================================
18020.492: [GC [PSYoungGen: 161888K->1376K(166016K)] 949359K->789159K(1214592K), 0.0294550 secs]
...
========================================
SUMMARY:
========================================
# GC Events: 46044
GC Event Types: PARALLEL_SCAVENGE, PARALLEL_SERIAL_OLD
Max Heap Space: 1566912K
Max Heap Occupancy: 1562164K
Max Perm Space: 77864K
Max Perm Occupancy: 46645K
Throughput: 99%
Max Pause: 4098 ms
Total Pause: 1703657 ms
First Timestamp: 4616 ms
Last Timestamp: 232465068 ms
========================================
0 UNIDENTIFIED LOG LINE(S):
Applications also might have classloading
problems
Tattletale
JBoss AS7 has JDR
Wait a minute! I tried to run jvisualvm in OpenJDK
and it says “command not found”
Thermostat – The next heat
Please Remember
● Don't develop applications without make use
of testing approaches (unit, integration,
functional, ...)
● Although all testing efforts, there is no 100%
bug free applications
● For all unpredictable and complex problems,
this presentation will help you troubleshoot, if
not all, most of the problem
The links
● http://icedtea.classpath.org/wiki/Thermostat
● http://eclipse.org/mat/
● http://yusuke.homeip.net/samurai/en/index.html
● https://code.google.com/a/eclipselabs.org/p/garbagecat/
● http://docs.oracle.com/javase/7/docs/index.html
● http://www.jboss.org/tattletale
● http://jboss.org/byteman
Twitter: @rimolive
http://aprendendo-cloud-computing.blogspot.com
Thank you!
What about Byteman?
Race Condition Tests with Byteman
Flávia Rainone
Don't miss it!

Contenu connexe

Similaire à Jud con presentation_brazil

JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
Kai Koenig
 
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
 

Similaire à Jud con presentation_brazil (20)

Tools for Metaspace
Tools for MetaspaceTools for Metaspace
Tools for Metaspace
 
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 Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage Collector
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
Am I reading GC logs Correctly?
Am I reading GC logs Correctly?Am I reading GC logs Correctly?
Am I reading GC logs Correctly?
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and Profiling
 
Java Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderJava Performance and Using Java Flight Recorder
Java Performance and Using Java Flight Recorder
 
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
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
look inside your (Liferay) portal
look inside your (Liferay) portallook inside your (Liferay) portal
look inside your (Liferay) portal
 
Java gpu computing
Java gpu computingJava gpu computing
Java gpu computing
 
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
 
Why you should be using structured logs
Why you should be using structured logsWhy you should be using structured logs
Why you should be using structured logs
 
Become a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsBecome a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day Devops
 
Qt5 on ti processors
Qt5 on ti processorsQt5 on ti processors
Qt5 on ti processors
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
 
How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
 

Plus de Ricardo Martinelli de Oliveira

De zero a cem em cloud computing transformando idéias em aplicações em pouco...
De zero a cem em cloud computing  transformando idéias em aplicações em pouco...De zero a cem em cloud computing  transformando idéias em aplicações em pouco...
De zero a cem em cloud computing transformando idéias em aplicações em pouco...
Ricardo Martinelli de Oliveira
 

Plus de Ricardo Martinelli de Oliveira (20)

Ensuring Software Quality in the cloud
Ensuring Software Quality in the cloudEnsuring Software Quality in the cloud
Ensuring Software Quality in the cloud
 
Java em containers Docker: Paraíso ou esquecimento?
Java em containers Docker: Paraíso ou esquecimento?Java em containers Docker: Paraíso ou esquecimento?
Java em containers Docker: Paraíso ou esquecimento?
 
Garantindo a qualidade do seu software na nuvem
Garantindo a qualidade do seu software na nuvemGarantindo a qualidade do seu software na nuvem
Garantindo a qualidade do seu software na nuvem
 
Mensageria sob Demanda: Uma introdução ao MaaS (Messaging-as-a-Service)
Mensageria sob Demanda: Uma introdução ao MaaS (Messaging-as-a-Service)Mensageria sob Demanda: Uma introdução ao MaaS (Messaging-as-a-Service)
Mensageria sob Demanda: Uma introdução ao MaaS (Messaging-as-a-Service)
 
Spark nas-nuvens
Spark nas-nuvensSpark nas-nuvens
Spark nas-nuvens
 
Do código ao Sucesso com Source-To-Image
Do código ao Sucesso com Source-To-ImageDo código ao Sucesso com Source-To-Image
Do código ao Sucesso com Source-To-Image
 
Exporando xpaas-8
Exporando xpaas-8Exporando xpaas-8
Exporando xpaas-8
 
Construindo uma-carreira-open-source
Construindo uma-carreira-open-sourceConstruindo uma-carreira-open-source
Construindo uma-carreira-open-source
 
Fedora 24 Release party
Fedora 24 Release partyFedora 24 Release party
Fedora 24 Release party
 
Novas oportunidades para o .net com a parceria microsoft e red hat
Novas oportunidades para o .net com a parceria microsoft e red hatNovas oportunidades para o .net com a parceria microsoft e red hat
Novas oportunidades para o .net com a parceria microsoft e red hat
 
Openshift v3-a-revolucao-dos-containers-3
Openshift v3-a-revolucao-dos-containers-3Openshift v3-a-revolucao-dos-containers-3
Openshift v3-a-revolucao-dos-containers-3
 
Putting a-heat-with-thermostat
Putting a-heat-with-thermostatPutting a-heat-with-thermostat
Putting a-heat-with-thermostat
 
Idaas sso-openshift
Idaas sso-openshiftIdaas sso-openshift
Idaas sso-openshift
 
Migracao gae-openshift
Migracao gae-openshiftMigracao gae-openshift
Migracao gae-openshift
 
Byteman: Tudo o que queria saber mas não sabia a quem perguntar
Byteman: Tudo o que queria saber mas não sabia a quem perguntarByteman: Tudo o que queria saber mas não sabia a quem perguntar
Byteman: Tudo o que queria saber mas não sabia a quem perguntar
 
Boas vindas - JBUG:Brasil
Boas vindas - JBUG:BrasilBoas vindas - JBUG:Brasil
Boas vindas - JBUG:Brasil
 
Sua aplicação nas nuvens com open shift
Sua aplicação nas nuvens com open shiftSua aplicação nas nuvens com open shift
Sua aplicação nas nuvens com open shift
 
De zero a cem em cloud computing transformando idéias em aplicações em pouco...
De zero a cem em cloud computing  transformando idéias em aplicações em pouco...De zero a cem em cloud computing  transformando idéias em aplicações em pouco...
De zero a cem em cloud computing transformando idéias em aplicações em pouco...
 
De zero a cem em cloud computing transformando idéias em aplicações em pouco...
De zero a cem em cloud computing  transformando idéias em aplicações em pouco...De zero a cem em cloud computing  transformando idéias em aplicações em pouco...
De zero a cem em cloud computing transformando idéias em aplicações em pouco...
 
JEE nas nuvens: uma introdução ao openshift
JEE nas nuvens:  uma introdução ao openshiftJEE nas nuvens:  uma introdução ao openshift
JEE nas nuvens: uma introdução ao openshift
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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 ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
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...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Jud con presentation_brazil

  • 1.
  • 2. The Developer Swiss Knife: Troubleshooting Tools for Java EE Applications
  • 3. Assumptions •This presentation aims experienced developers with a little (but good) knowledge about how the JVM works •The presentation focus only on the tools, not on the troubleshooting methods •Some of the tools are only for Linux. Windows users, get out! =P •All tools presented in this presentation are Open Source projects and some of them are developed by JBoss
  • 5. The Tools •JDK CLI Tools (jstack, jmap, jps, etc.) •JDK GUI Tools (JVisualVM, JConsole) •Eclipse Memory Analyzer Tool (MAT) •Thermostat •Garbagecat •Samurai •AS7 JDR (JBoss Disaster Report) tool •Tattletale •Byteman*
  • 6. JDK has its own troubleshooting tools ● jps ● jmap ● jinfo ● jhat ● jstack
  • 7. Some of them are Graphical ● JConsole ● JVisualVM
  • 8. What should I do when my application has a memory problem?
  • 9. Generating a Heap Dump ● -XX:-HeapDumpOnOutOfMemoryError ● jmap ● JVisualVM
  • 10. Ok, I have a Heap Dump. Now can I analyze it?
  • 12. What should I do if my application have a CPU problem? e.g. High CPU consumption
  • 13. Generating a Thread Dump ● jstack ● kill -3 ● AS7 CLI command: – /core-service=platform- mbean/type=threading:dump-all-threads(locked- monitors=true,locked-synchronizers=true)
  • 14. Now with a Thread Dump, what should I do with it?
  • 15. Samurai – A Thread Dump viewer
  • 16. High CPU consumption can be high GC activity
  • 17. Enabling GC Logging ● Add to java command: -XX:+PrintGC -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
  • 18. GC Log content 3.122: [GC 132096K->24592K(504320K), 0.0321910 secs] 4.558: [GC 156688K->26752K(504320K), 0.0340520 secs] 6.609: [GC 158848K->50117K(504320K), 0.0628430 secs] 7.077: [GC 80334K->54921K(504320K), 0.0416730 secs] 7.119: [Full GC 54921K->46716K(504320K), 0.2522170 secs] 8.510: [GC 178812K->60924K(504320K), 0.0190690 secs] 9.683: [GC 193020K->69447K(461696K), 0.0308020 secs]
  • 19. Garbagecat java -jar garbagecat-1.0.0.jar --help usage: garbagecat [OPTION]... [FILE] -h,--help help -o,--options <arg> JVM options used during JVM run -p,--preprocess preprocessing flag -s,--startdatetime <arg> JVM start datetime (yyyy-MM-dd HH:mm:ss,SSS) for converting GC logging timestamps to datetime -t,--threshold <arg> threshold (0-100) for throughput bottleneck reporting
  • 20. Garbagecat report ======================================== Throughput less than 90% for PARALLEL_SCAVENGE ======================================== 18020.492: [GC [PSYoungGen: 161888K->1376K(166016K)] 949359K->789159K(1214592K), 0.0294550 secs] ... ======================================== SUMMARY: ======================================== # GC Events: 46044 GC Event Types: PARALLEL_SCAVENGE, PARALLEL_SERIAL_OLD Max Heap Space: 1566912K Max Heap Occupancy: 1562164K Max Perm Space: 77864K Max Perm Occupancy: 46645K Throughput: 99% Max Pause: 4098 ms Total Pause: 1703657 ms First Timestamp: 4616 ms Last Timestamp: 232465068 ms ======================================== 0 UNIDENTIFIED LOG LINE(S):
  • 21. Applications also might have classloading problems
  • 24. Wait a minute! I tried to run jvisualvm in OpenJDK and it says “command not found”
  • 25. Thermostat – The next heat
  • 26. Please Remember ● Don't develop applications without make use of testing approaches (unit, integration, functional, ...) ● Although all testing efforts, there is no 100% bug free applications ● For all unpredictable and complex problems, this presentation will help you troubleshoot, if not all, most of the problem
  • 27. The links ● http://icedtea.classpath.org/wiki/Thermostat ● http://eclipse.org/mat/ ● http://yusuke.homeip.net/samurai/en/index.html ● https://code.google.com/a/eclipselabs.org/p/garbagecat/ ● http://docs.oracle.com/javase/7/docs/index.html ● http://www.jboss.org/tattletale ● http://jboss.org/byteman Twitter: @rimolive http://aprendendo-cloud-computing.blogspot.com
  • 30. Race Condition Tests with Byteman Flávia Rainone Don't miss it!