SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
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!

Mais conteúdo relacionado

Semelhante a Jud con presentation_brazil

Taming Java Garbage Collector
Taming Java Garbage CollectorTaming Java Garbage Collector
Taming Java Garbage CollectorDaya Atapattu
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance TuningJeremy Leisy
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsPoonam Bajaj Parhar
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai 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
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and ProfilingWSO2
 
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 RecorderIsuru Perera
 
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 ConferenceTier1app
 
YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceBrendan Gregg
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
look inside your (Liferay) portal
look inside your (Liferay) portallook inside your (Liferay) portal
look inside your (Liferay) portalIBACZ
 
Java gpu computing
Java gpu computingJava gpu computing
Java gpu computingArjan Lamers
 
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.pptxTier1 app
 
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 logsStefan Krawczyk
 
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 DevopsTier1app
 
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 GulpAll Things Open
 
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...Red Hat Developers
 

Semelhante a 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...
 

Mais de Ricardo Martinelli de Oliveira

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)Ricardo Martinelli de Oliveira
 
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 hatRicardo Martinelli de Oliveira
 
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 perguntarRicardo 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
 
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
 

Mais 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
 

Último

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

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!