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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kengo TODA
October 16, 2012
Technology
300
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
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
180
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
210
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
2.2k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.9k
ヒューマンスキル / The Humanskills
eller86
0
770
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
540
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.7k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
2.2k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.6k
Other Decks in Technology
See All in Technology
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
ラジオの科学
frievea
0
310
【Google Cloud Next Tokyo'26】Gemini Enterprise と Oracle AI Database で実現する、業務データ活用を実現する AI エージェント実装
shisyu_gaku
0
250
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
260
ブラウザ研修 2026
recruitengineers
PRO
6
990
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
150
Sets in Go
ramalho
1
610
LanceDB入門
mocobeta
7
500
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
1
400
Model Studio CLI × Token Plan
maigo999
0
180
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
840
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
700
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
760
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Building the Perfect Custom Keyboard
takai
2
840
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
380
Game over? The fight for quality and originality in the time of robots
wayneb77
1
240
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
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