SlideShare a Scribd company logo
Java Performance Debugging
Few Questions to Consider
•   What is expected throughput
•   What is expected latency
•   Maximum No. of concurrent users/tasks
•   Expected Throughput/latency at max users
•   Worst case latency
•   Tolerable GC latency
Bottlenecks
•   Memory
•   CPU
•   Disk I/O
•   Network I/O
Memory (RAM)
•   -Xmx too low
•   Process leaking memory (et tu java!)
•   Insufficient DirectBuffers
•   Insufficient PermGen space
•   Page thrashing
Memory (Contd.)
• Run –XX:+HeapDumpOnOutOfMemoryError.
  Check .hprof files in working directory or –
  XX:HeapDumpPath

• jmap –histo<pid>
Memory (contd.)



• High si/so coinciding with low ā€˜free’ memory
  implies page thrashing
Other OutOfMemory Errors
• Incorrect PermGen size –XXMaxPermSize
  –   java.lang.OutOfMemoryError: PermGen space

  – jstat -gc<pid>
  – Can monitory ā€˜PU’ vs ā€˜PGCMX’ from jstat -
    gccapacity
• Incorrect Direct Buffer limit -
  XX:MaxDirectMemorySize
  –   java.lang.OutOfMemoryError: Direct buffer memory
CPU
• Check Garbage collector stats
  – Jstat –gc<pid>
• Investigate using – JMX, TOP
  – Using TOP get the thread ID
  – Thread Dump using ā€˜kill -3’ or ā€˜jstack’
  – Search Hex thread id in thread dump
Disk I/O
• Iostat %iowait<interval><samples>

• High %iowait indicates I/O bottleneck

• If java process is causing high I/O, check the
  thread dump
Java Heap Structure
Garbage Collector Choice
• Serial GC (Never use this!)
  – -XX:+UseSerialGC
• Parallel GC (High Throughput) – Use in non-
  interactive jobs which can tolerate pause of 1-
  2 sec
  – -XX:+UseParallelGC –XX:+UseParallelOldGC
• CMS (Low Latency) – Good for webapps and
  interactive processes
  – -XX:+UseConcMarkSweepGC

More Related Content

PPT
Php perf
ericjonah
Ā 
PDF
Odoo Online platform: architecture and challenges
Odoo
Ā 
PDF
java-monitoring-troubleshooting
William Au
Ā 
PDF
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
Alexey Lesovsky
Ā 
PDF
XtraDB 5.6 and 5.7: Key Performance Algorithms
Laurynas Biveinis
Ā 
PDF
XtraDB 5.7: key performance algorithms
Laurynas Biveinis
Ā 
PDF
Postgresql database administration volume 1
Federico Campoli
Ā 
PDF
Tsung info
Branden Visser
Ā 
Php perf
ericjonah
Ā 
Odoo Online platform: architecture and challenges
Odoo
Ā 
java-monitoring-troubleshooting
William Au
Ā 
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
Alexey Lesovsky
Ā 
XtraDB 5.6 and 5.7: Key Performance Algorithms
Laurynas Biveinis
Ā 
XtraDB 5.7: key performance algorithms
Laurynas Biveinis
Ā 
Postgresql database administration volume 1
Federico Campoli
Ā 
Tsung info
Branden Visser
Ā 

What's hot (20)

PDF
Hypertable Nosql
elliando dias
Ā 
PPTX
MongoDB Memory Management Demystified
MongoDB
Ā 
PDF
Odoo Performance Limits
Odoo
Ā 
PDF
Managing PostgreSQL with PgCenter
Alexey Lesovsky
Ā 
PDF
Make the prompt great again
jtyr
Ā 
PDF
Pgcenter overview
Alexey Lesovsky
Ā 
PPTX
Nvvp streams-3
Josh Wyatt
Ā 
ODP
Easy distributed load test with Tsung
Ngoc Dao
Ā 
PDF
Tsung Intro presentation 2013
Steffen Larsen
Ā 
PDF
Troubleshooting PostgreSQL with pgCenter
Alexey Lesovsky
Ā 
PDF
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
Tomas Vondra
Ā 
PDF
ć‚¼ćƒ­ć‹ć‚‰å§‹ć‚ć‚‹ćƒ•ć‚”ćƒŸć‚³ćƒ³ć‚ØćƒŸćƒ„ćƒ¬ćƒ¼ć‚æē”Ÿę“» PHPerKaigi2019
ichikaway
Ā 
PDF
My talk from PgConf.Russia 2016
Alex Chistyakov
Ā 
PDF
Troubleshooting PostgreSQL Streaming Replication
Alexey Lesovsky
Ā 
PDF
Hello, Worldまで3ヶ月 Golangć§ćƒ•ć‚”ćƒŸć‚³ćƒ³ć‚ØćƒŸćƒ„ćƒ¬ćƒ¼ć‚æå®Ÿč£… #gocon fukuoka 2019
ichikaway
Ā 
PDF
Elephant Roads: a tour of Postgres forks
Command Prompt., Inc
Ā 
PDF
Introduction to using MongoDB with Ruby
Jonathan Holloway
Ā 
PDF
Go performance tooling
Adil Hafeez
Ā 
PDF
Patroni - HA PostgreSQL made easy
Alexander Kukushkin
Ā 
TXT
Xusage
Martolea Ariana
Ā 
Hypertable Nosql
elliando dias
Ā 
MongoDB Memory Management Demystified
MongoDB
Ā 
Odoo Performance Limits
Odoo
Ā 
Managing PostgreSQL with PgCenter
Alexey Lesovsky
Ā 
Make the prompt great again
jtyr
Ā 
Pgcenter overview
Alexey Lesovsky
Ā 
Nvvp streams-3
Josh Wyatt
Ā 
Easy distributed load test with Tsung
Ngoc Dao
Ā 
Tsung Intro presentation 2013
Steffen Larsen
Ā 
Troubleshooting PostgreSQL with pgCenter
Alexey Lesovsky
Ā 
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
Tomas Vondra
Ā 
ć‚¼ćƒ­ć‹ć‚‰å§‹ć‚ć‚‹ćƒ•ć‚”ćƒŸć‚³ćƒ³ć‚ØćƒŸćƒ„ćƒ¬ćƒ¼ć‚æē”Ÿę“» PHPerKaigi2019
ichikaway
Ā 
My talk from PgConf.Russia 2016
Alex Chistyakov
Ā 
Troubleshooting PostgreSQL Streaming Replication
Alexey Lesovsky
Ā 
Hello, Worldまで3ヶ月 Golangć§ćƒ•ć‚”ćƒŸć‚³ćƒ³ć‚ØćƒŸćƒ„ćƒ¬ćƒ¼ć‚æå®Ÿč£… #gocon fukuoka 2019
ichikaway
Ā 
Elephant Roads: a tour of Postgres forks
Command Prompt., Inc
Ā 
Introduction to using MongoDB with Ruby
Jonathan Holloway
Ā 
Go performance tooling
Adil Hafeez
Ā 
Patroni - HA PostgreSQL made easy
Alexander Kukushkin
Ā 
Xusage
Martolea Ariana
Ā 
Ad

Viewers also liked (20)

PDF
Creating High Performance Big Data Applications with the Java Persistence API
DATAVERSITY
Ā 
PPT
Optimizing Java Performance
Konstantin Pavlov
Ā 
PDF
High Performance With Java
malduarte
Ā 
PDF
Performance van Java 8 en verder - Jeroen Borgers
NLJUG
Ā 
PDF
High Performance Web Design
Koji Ishimoto
Ā 
PDF
Java Performance
SSA KPI
Ā 
PDF
Java Performance & Profiling
Isuru Perera
Ā 
PDF
WSO2 Identity Server
Prabath Siriwardena
Ā 
PPTX
Microservices for performance - GOTO Chicago 2016
Peter Lawrey
Ā 
PPT
Java Performance, Threading and Concurrent Data Structures
Hitendra Kumar
Ā 
PPTX
High performance java ee with j cache and cdi
Payara
Ā 
PDF
SSO with the WSO2 Identity Server
WSO2
Ā 
PPT
Practical Steps For Building High Performance Teams
Elijah Ezendu
Ā 
PDF
High-performance Team Development
Peter Pfeiffer
Ā 
PPT
Leading High Performance Teams
Ubersoldat
Ā 
PPTX
WSO2 Identity Server 5.3.0 - Product Release Webinar
WSO2
Ā 
PDF
High Performance Java EE with JCache and CDI
Payara
Ā 
PPTX
SAML Smackdown
Pat Patterson
Ā 
PPTX
High Performance Flow Matching Architecture for Openflow Data Plane
Mahesh Dananjaya
Ā 
PDF
SAML Protocol Overview
Mike Schwartz
Ā 
Creating High Performance Big Data Applications with the Java Persistence API
DATAVERSITY
Ā 
Optimizing Java Performance
Konstantin Pavlov
Ā 
High Performance With Java
malduarte
Ā 
Performance van Java 8 en verder - Jeroen Borgers
NLJUG
Ā 
High Performance Web Design
Koji Ishimoto
Ā 
Java Performance
SSA KPI
Ā 
Java Performance & Profiling
Isuru Perera
Ā 
WSO2 Identity Server
Prabath Siriwardena
Ā 
Microservices for performance - GOTO Chicago 2016
Peter Lawrey
Ā 
Java Performance, Threading and Concurrent Data Structures
Hitendra Kumar
Ā 
High performance java ee with j cache and cdi
Payara
Ā 
SSO with the WSO2 Identity Server
WSO2
Ā 
Practical Steps For Building High Performance Teams
Elijah Ezendu
Ā 
High-performance Team Development
Peter Pfeiffer
Ā 
Leading High Performance Teams
Ubersoldat
Ā 
WSO2 Identity Server 5.3.0 - Product Release Webinar
WSO2
Ā 
High Performance Java EE with JCache and CDI
Payara
Ā 
SAML Smackdown
Pat Patterson
Ā 
High Performance Flow Matching Architecture for Openflow Data Plane
Mahesh Dananjaya
Ā 
SAML Protocol Overview
Mike Schwartz
Ā 
Ad

Similar to Java performance (20)

PDF
Web Sphere Problem Determination Ext
Rohit Kelapure
Ā 
PPTX
Java performance tuning
Mohammed Fazuluddin
Ā 
PDF
Tools and Tips to Diagnose Performance Issues
Claudio Miranda
Ā 
PPTX
Application Profiling for Memory and Performance
pradeepfn
Ā 
PDF
Taming The JVM
Matthew McCullough
Ā 
PPTX
Jvm problem diagnostics
Danijel Mitar
Ā 
PDF
Troubleshooting Memory Problems in Java Applications
Poonam Bajaj Parhar
Ā 
PPTX
Effectively Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
Ā 
PDF
Software Profiling: Java Performance, Profiling and Flamegraphs
Isuru Perera
Ā 
PPTX
jvm.pptx
senthilnathan662693
Ā 
ODP
Jvm tuning in a rush! - Lviv JUG
Tomek Borek
Ā 
PDF
Application Profiling for Memory and Performance
WSO2
Ā 
PDF
Java on Linux for devs and ops
aragozin
Ā 
PDF
Java Performance and Profiling
WSO2
Ā 
PPT
Best Practices for performance evaluation and diagnosis of Java Applications ...
IndicThreads
Ā 
PDF
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Haribabu Nandyal Padmanaban
Ā 
PPTX
Java performance tuning
Shivaji Chelladurai
Ā 
PDF
JavaOne 2014: Java Debugging
Chris Bailey
Ā 
PDF
Java Performance and Using Java Flight Recorder
Isuru Perera
Ā 
PDF
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
srisatish ambati
Ā 
Web Sphere Problem Determination Ext
Rohit Kelapure
Ā 
Java performance tuning
Mohammed Fazuluddin
Ā 
Tools and Tips to Diagnose Performance Issues
Claudio Miranda
Ā 
Application Profiling for Memory and Performance
pradeepfn
Ā 
Taming The JVM
Matthew McCullough
Ā 
Jvm problem diagnostics
Danijel Mitar
Ā 
Troubleshooting Memory Problems in Java Applications
Poonam Bajaj Parhar
Ā 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
Ā 
Software Profiling: Java Performance, Profiling and Flamegraphs
Isuru Perera
Ā 
Jvm tuning in a rush! - Lviv JUG
Tomek Borek
Ā 
Application Profiling for Memory and Performance
WSO2
Ā 
Java on Linux for devs and ops
aragozin
Ā 
Java Performance and Profiling
WSO2
Ā 
Best Practices for performance evaluation and diagnosis of Java Applications ...
IndicThreads
Ā 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Haribabu Nandyal Padmanaban
Ā 
Java performance tuning
Shivaji Chelladurai
Ā 
JavaOne 2014: Java Debugging
Chris Bailey
Ā 
Java Performance and Using Java Flight Recorder
Isuru Perera
Ā 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
srisatish ambati
Ā 

Recently uploaded (20)

PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
Ā 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
PDF
Software Development Methodologies in 2025
KodekX
Ā 
PPTX
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
Ā 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
Ā 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
Ā 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
Ā 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
Ā 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
Ā 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
Ā 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
Ā 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
Ā 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
Ā 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
Ā 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 
Brief History of Internet - Early Days of Internet
sutharharshit158
Ā 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
Ā 
Software Development Methodologies in 2025
KodekX
Ā 
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
Ā 
REPORT: Heating appliances market in Poland 2024
SPIUG
Ā 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
Ā 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
Ā 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
Ā 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
Ā 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
Ā 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
Ā 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
Ā 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
Ā 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
Ā 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
Ā 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
Ā 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
Ā 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
Ā 
Presentation about Hardware and Software in Computer
snehamodhawadiya
Ā 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
Ā 

Java performance

  • 2. Few Questions to Consider • What is expected throughput • What is expected latency • Maximum No. of concurrent users/tasks • Expected Throughput/latency at max users • Worst case latency • Tolerable GC latency
  • 3. Bottlenecks • Memory • CPU • Disk I/O • Network I/O
  • 4. Memory (RAM) • -Xmx too low • Process leaking memory (et tu java!) • Insufficient DirectBuffers • Insufficient PermGen space • Page thrashing
  • 5. Memory (Contd.) • Run –XX:+HeapDumpOnOutOfMemoryError. Check .hprof files in working directory or – XX:HeapDumpPath • jmap –histo<pid>
  • 6. Memory (contd.) • High si/so coinciding with low ā€˜free’ memory implies page thrashing
  • 7. Other OutOfMemory Errors • Incorrect PermGen size –XXMaxPermSize – java.lang.OutOfMemoryError: PermGen space – jstat -gc<pid> – Can monitory ā€˜PU’ vs ā€˜PGCMX’ from jstat - gccapacity • Incorrect Direct Buffer limit - XX:MaxDirectMemorySize – java.lang.OutOfMemoryError: Direct buffer memory
  • 8. CPU • Check Garbage collector stats – Jstat –gc<pid> • Investigate using – JMX, TOP – Using TOP get the thread ID – Thread Dump using ā€˜kill -3’ or ā€˜jstack’ – Search Hex thread id in thread dump
  • 9. Disk I/O • Iostat %iowait<interval><samples> • High %iowait indicates I/O bottleneck • If java process is causing high I/O, check the thread dump
  • 11. Garbage Collector Choice • Serial GC (Never use this!) – -XX:+UseSerialGC • Parallel GC (High Throughput) – Use in non- interactive jobs which can tolerate pause of 1- 2 sec – -XX:+UseParallelGC –XX:+UseParallelOldGC • CMS (Low Latency) – Good for webapps and interactive processes – -XX:+UseConcMarkSweepGC