THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING

Similar documents
THE BUSY JAVA DEVELOPER'S GUIDE TO WEBSPHERE DEBUGGING & TROUBLESHOOTING

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

How To Improve Performance On An Asa 9.4 Web Application Server (For Advanced Users)

Java Debugging Ľuboš Koščo

How To Use Java On An Ipa (Jspa) With A Microsoft Powerbook (Jempa) With An Ipad And A Microos 2.5 (Microos)

Practical Performance Understanding the Performance of Your Application

Oracle Corporation Proprietary and Confidential

<Insert Picture Here> Java Application Diagnostic Expert

Using jvmstat and visualgc to Solve Memory Management Problems

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

Holly Cummins IBM Hursley Labs. Java performance not so scary after all

Java Troubleshooting and Performance

Troubleshoot the JVM like never before. JVM Troubleshooting Guide. Pierre-Hugues Charbonneau Ilias Tsagklis

Effective Java Programming. measurement as the basis

WebSphere Architect (Performance and Monitoring) 2011 IBM Corporation

VisualVM: Integrated and Extensible Troubleshooting Tool for the Java Platform

Java VM monitoring and the Health Center API. William Smith

Tool - 1: Health Center

Debug 101-Using ISA Tools for Apps in WebSphere Application Server z/os

TDA - Thread Dump Analyzer

WEBLOGIC ADMINISTRATION

Outline: ISA Tools for WebSphere Comments: on z/os

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

What s Cool in the SAP JVM (CON3243)

Debugging Java performance problems. Ryan Matteson

Java Performance Tuning

IBM Software Group. SW5706 JVM Tools IBM Corporation 4.0. This presentation will act as an introduction to JVM tools.

IBM SDK, Java Technology Edition Version 1. IBM JVM messages IBM

Monitoring applications in multitier environment. Uroš Majcen A New View on Application Management.

Instrumentation Software Profiling

Advanced Performance Forensics

A Practical Method to Diagnose Memory Leaks in Java Application Alan Yu

JBoss Cookbook: Secret Recipes. David Chia Senior TAM, JBoss May 5 th 2011

How to use IBM HeapAnalyzer to diagnose Java heap issues

Oracle WebLogic Server 11g: Monitor and Tune Performance

Robert Honeyman

Performance Monitoring and Tuning. Liferay Chicago User Group (LCHIUG) James Lefeu 29AUG2013

Liferay Performance Tuning

Tools in the Box. Quick overview on helpful tools in the JDK and use cases for them. Florin Bunau

Web Performance, Inc. Testing Services Sample Performance Analysis

Enterprise Manager Performance Tips

Production time profiling On-Demand with Java Flight Recorder

Oracle JRockit Mission Control Overview

Essentials of Java Performance Tuning. Dr Heinz Kabutz Kirk Pepperdine Sun Java Champions

Eclipse Visualization and Performance Monitoring

CSE 403. Performance Profiling Marty Stepp

Tomcat Tuning. Mark Thomas April 2009

Java Performance. Adrian Dozsa TM-JUG

BEAJRockit Mission Control. Using JRockit Mission Control in the Eclipse IDE

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

B M C S O F T W A R E, I N C. BASIC BEST PRACTICES. Ross Cochran Principal SW Consultant

Monitoring and Managing a JVM

Oracle WebLogic Server Monitoring and Performance Tuning

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

Three Simple Ways to Master the Administration and Management of an MDM Hub

Winning the J2EE Performance Game Presented to: JAVA User Group-Minnesota

Eclipse Memory Analyzer and other Java stuff

A technical guide for monitoring Adobe LiveCycle ES deployments

Weblogic Server Administration Top Ten Concepts. Mrityunjay Kant, AST Corporation Scott Brinker, College of American Pathologist

The Fundamentals of Tuning OpenJDK

Discovering Performance Bottlenecks with the SAP JVM Profiler and SAP Memory Analyzer

WAS Performance on i5/os. Lisa Wellman May 2010

HeapStats: Your Dependable Helper for Java Applications, from Development to Operation

Extreme Performance with Java

Zing Vision. Answering your toughest production Java performance questions

WebSphere Performance Monitoring & Tuning For Webtop Version 5.3 on WebSphere 5.1.x

Java Garbage Collection Best Practices for Sizing and Tuning the Java Heap

Informatica Master Data Management Multi Domain Hub API: Performance and Scalability Diagnostics Checklist

An Oracle White Paper September, Enterprise Manager 12c Cloud Control: Monitoring and Managing Oracle Coherence for High Performance

Diagnosing Production Java Applications Madhav Sathe

PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design

IBM Tivoli Composite Application Manager for WebSphere

Tuning Your GlassFish Performance Tips. Deep Singh Enterprise Java Performance Team Sun Microsystems, Inc.

Identifying Performance Bottleneck using JRockit. - Shivaram Thirunavukkarasu Performance Engineer Wipro Technologies

Apache Tomcat Tuning for Production

Java in Virtual Machines on VMware ESX: Best Practices

MONITORING A WEBCENTER CONTENT DEPLOYMENT WITH ENTERPRISE MANAGER

MID-TIER DEPLOYMENT KB

How To Manage An Sap Solution

Oracle WebLogic Thread Pool Tuning

Profiling and Testing with Test and Performance Tools Platform (TPTP)

NetBeans Profiler is an

Monitoring HP OO 10. Overview. Available Tools. HP OO Community Guides

Monitoring and Diagnosing Production Applications Using Oracle Application Diagnostics for Java. An Oracle White Paper December 2007

1 How to Monitor Performance

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

WebLogic Server System Administration Top Ten Fundamentals Concepts Session ID# 11579

Java Mission Control

Mission-Critical Java. An Oracle White Paper Updated October 2008

AGENDA. Introduction About Weblogic Server Weblogic Server Administration Top Ten Concepts Q & A

An Oracle White Paper March Load Testing Best Practices for Oracle E- Business Suite using Oracle Application Testing Suite

Top 10 Issues for Java in Production. SriSatish Ambati Cliff Click Jr. Azul Systems, Inc

WebSphere Application Server V7: Monitoring the Runtime

IBM Tivoli Composite Application Manager for WebSphere

Java Garbage Collection Basics

Performance rule violations usually result in increased CPU or I/O, time to fix the mistake, and ultimately, a cost to the business unit.

Transcription:

THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING November 5, 2010 Rohit Kelapure HTTP://WWW.LINKEDIN.COM/IN/ROHITKELAPURE HTTP://TWITTER.COM/RKELA

Agenda 2 Application Server component overview Support Assistant JVM Troubleshooting Tools Problem Determination Tools Scenario based problem resolution How customers get in trouble BadApp Demo Q&A

3 Component Overview

4 Support Assistant Workbench to help with Problem Determination

5 Analyze Problem

Tools Problem Artifact Monitoring & Analysis Memory leaks 6 Out of Memory errors Application Unresponsive Verbose Garbage collection log (native_stdout.log) PMAT,GCMV VisualGC jps, jstat, jstatd, jinfo High CPU, Crash, Hang, Performance bottleneck, Unexpected termination Lock Contention Low CPU at high load Memory Leak Out of Memory errors Native Memory Leak Anomalies Unexpected Crash Javadump, Javacore (javacore*.txt) Threads (Connection to running JVM) Heapdump (*.phd, *.txt, *.hprof) System or core dump (core.dmp, user.dmp), Files must be processed with jextract tool Thread Monitor & Dump Analyzer (TMDA), Samurai TDA Jstack Sun VisualVM JConsole IBM Health Center Jrockit Mission Control MAT HeapAnalyzer JHat Monitor - GCMV, Examine - pmap & VMMap, Track - DebugDiag, libumem, valgrind, cmalloc & NJAMD

Runtime Serviceability aids 7 Troubleshooting panels in the admin console Performance Monitoring Infrastructure metrics Diagnostic Provider Mbeans Dump Configuration, State and run self-test Application Response Measurement/Request Metrics Follow transaction end-to-end and find bottlenecks Trace logs & First Failure Data Capture Runtime Performance Advisors Memory leak detection, session size, Specialized tracing and Runtime checks Tomcat Classloader Leak Detection Session crossover, Connection leak, ByteBuffer leak detection Runaway CPU thread protection

One more tool and I am going to scream

Most common JVM Problem 9 Scenarios Functional Problems Unexpected Exceptions, Compatibility OOM Errors Java Heap,Native Heap Classloaders Hangs Synchronized resources, GC Pause times Crash JVM errors, JIT errors, JNI errors High CPU Spin loops

Find Dominating consumer Actors Usage patterns Average response/service time, # of requests/transactions, # of live HTTP sessions Application Locks, External Systems Web server thread pools, Web & EJB Container, Threadpools, DB conn pool sizes JVM/OS Memory, Hardware Management Hardware CPU, Paging Memory, Disk I/O, Network

WTF is wrong with my app Why does my app. run slow every time I do? Why does my app. have erratic response times? Why am I getting Out of Memory Errors? What is my applications memory footprint? Which parts of my app. are CPU intensive? How did my JVM vanish without a trace? Why is my application unresponsive? What monitoring do I put in place for my app.?

App runs slow when I do xxx? Understand impact of activity on components Look at the thread & method profiles IBM Java Health Center Visual VM Jrockit Mission Control JVM method & dump trace - pinpoint performance problems. Shows entry & exit times of any Java method Method to trace to file for all methods in tests.mytest.package Allows taking javadump, heapdump, etc when a method is hit Dump javacore when method testinnermethod in an inner class TestInnerClass of a class TestClass is called Use Btrace, -Xtrace * Xdump to trigger dumps on a range of events gpf, user, abort, fullgc, slow, allocation, thrstop, throw Stack traces, tool launching

App. has erratic response times? Verbose gc should be enabled by default <2% impact on performance VisualGC, GCMV &PMAT : Visualize GC output In use space after GC Positive gradient indicates memory leak Increased load (use for capacity plan) Memory leak (take HDs for PD.) Chose the right GC policy Optimized for batch type applications, consistent allocation profile Tight responsiveness criteria, allocations of large objects High rates of object burn, large # of transitional objects 12, 16 core SMP systems with allocation contention (AIX only) GC overhead > 10% wrong policy more tuning Enable compressed references for 64 bit JVM?

Out Of Memory Errors? JVM Heap sized incorrectly NOT recommended Xms == Xmx GC adapts heap size to keep occupancy [40, 70]% Determine heap occupancy of the app. under load Xmx = 43% larger than max. occupancy of app. For 700MB occupancy, 1000MB Max. heap is reqd. (700 +43% of 700) Analyze heapdumps & system dumps with dump tools Lack of Java heap or Native heap Finding which methods allocated large objects Prints stacktrace for all objects above 1K Enable Java Heap and Native heap monitoring JMX and metrics output by JVM Classloader exhaustion

Applications memory footprint? HPROF profiler shipped with JDK uses JVMTI Analysis of memory usage -Xrunhprof:heap=all Performance Inspector tools - JPROF Java Profiling Agent Capture state of the Java Heap later processed by HDUMP Use MAT to investigate heapdumps & system dumps Find large clumps, Inspect those objects, What retains them? Why is this object not being garbage collected List Objects > incoming refs, Path to GC roots, Immediate dominators Limit analysis to a single application in a JEE environment Dominator tree grouped by Class Loader Set of objects that can be reclaimed if we could delete X Retained Size Graphs Traditional memory hogs like HTTPSession, Cache Use Object Query Language (OQL)

CPU intensive parts of the app? HPROF - CPU spends most of its time -Xrunhrof:cpu=samples, -Xrunhprof:cpu=time JPROF method level execution times, who calls whom, etc. Generate startup script & set the JVM argument "-agentlib:jprof=rtarcf,callflow,logpath=./jprof" "-Xjit:disableInlining Output visualized using VPA ThreadDumps/Javacores - Poor mans profiler Periodic javacores Thread analysis TMDA

How did my JVM vanish without trace? JVM Process Crash Usual Suspects Bad JNI calls, Segmentation violations, Call Stack Overflow Native memory leaks - Object allocation fails with sufficient space in the JVM heap Unexpected OS exceptions (out of disk space, file handles), JIT failures Monitor the OS process size Runtime check of JVM memory allocations Xcheck:memory Native memory usage - Create a core dump on an OOM JNI code static analysis -Xcheck:jni (errors, warnings, advice) GCMV provides scripts and graphing for native memory Windows perfmon, Linux ps & AIX svmon Find the last stack of native code executing on the thread during the crash

18 What do I monitor?

no arch. plan No migration plan No change records Top Malpractices No Capacity plan No Production traffic profile Changes put directly in Prod. No load & Stress testing Communication breakdown No education Application Error Test environment!= Production

Demo, Q&A Eclipse Memory Analyzer Sun VisualVM Sun Visual GC Jconsole Samurai TDA Thread Monitor Dump Analyzer IBM Health Monitor Jrockit Mission Control