Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Profiling for JVM
Search
Kengo TODA
October 16, 2012
Technology
290
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Profiling for JVM
Simple introduction about how to judge the reason why your Java program is slow
Kengo TODA
October 16, 2012
More Decks by Kengo TODA
See All by Kengo TODA
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
190
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
2k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.8k
ヒューマンスキル / The Humanskills
eller86
0
760
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
530
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.6k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
2.2k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.5k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.7k
Other Decks in Technology
See All in Technology
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
380
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
440
LLMと共に進化するプロセスを目指して
ymatsuwitter
12
3.6k
Rubyで音を視る
ydah
1
110
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
560
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
200
AgentGatewayを試してみたかった
tkikuchi
0
120
Agentic Web
dynamis
1
180
React、まだ楽しくて草
uhyo
7
4.2k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
18
420k
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
260
OCI Oracle AI Database Services新機能アップデート(2026/03-2026/05)
oracle4engineer
PRO
0
290
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
We Have a Design System, Now What?
morganepeng
55
8.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
How to Ace a Technical Interview
jacobian
281
24k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Thoughts on Productivity
jonyablonski
76
5.2k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Cult of Friendly URLs
andyhume
79
6.9k
KATA
mclloyd
PRO
35
15k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Transcript
PROFILING FOR JVM How to verify your hypothesis - @eller86
1
Agenda Process to detect the cause of performance problem What
is “profiling”? Tools to profile 2
Process to detect the cause of performance problem Make hypothesis
from experience and knowledge Get Servlet’s log from middle ware like Jetty Read source code, do debugging, do profiling 3
What is “profiling”? where? why? GC storm algorithm CPU Other
reading code heap dump I/O Lock? Waiting other system? I/O GC Other thread dump IZQPUIFTJT WFSJpDBUJPO 4
Tools to profile jmap jstack jstat VisualVM 5
Overview 6
Judging the reason why JVM uses CPU heavily $ jstat
-gcutil [PID] 250 7 S0 S1 E O P YGC YGCT FGC FGCT GCT 12.44 0.00 27.20 9.49 96.70 78 0.176 5 0.495 0.672 12.44 0.00 62.16 9.49 96.70 78 0.176 5 0.495 0.672 12.44 0.00 83.97 9.49 96.70 78 0.176 5 0.495 0.672 0.00 7.74 0.00 9.51 96.70 79 0.177 5 0.495 0.673 0.00 7.74 23.37 9.51 96.70 79 0.177 5 0.495 0.673 0.00 7.74 43.82 9.51 96.70 79 0.177 5 0.495 0.673 0.00 7.74 58.11 9.51 96.71 79 0.177 5 0.495 0.673 GC was fired Young generation GC was fired 7
Detecting method which costs too much time 8
How to read method name Foo.x() means “method x of
Foo class” Foo$Bar.x() means “method x of Bar class, and Bar is inner class of Foo” Foo.<init> means “constructor of Foo class” Foo.<clinit> means “static initializer of Foo class” 9
Taking thread dump $ jstack -l [PID] > thread-dump.txt 10
Checking count of objects 11
Taking heap dump $ jmap -dump:format=b,file=dump.dat [PID] 12
Key points Hypothesis needs verification Know “normal” performance to detect
“abnormal” one Imagine globally, verify locally (narrow down step by step) 13
Reference JDK tools and utilities Browsing heap dump VisualVM Diagnosis
documentation @ developerWorks My gist about JVM profiling, blog article and another article 14