Unravelling the Alphabet Soup on ISA Session 1153
Ken Irwin
irwink@us.ibm.com
SHARE Denver
August 23, 2009
Agenda
Introducing Health Center Diagnosing problems with Health Center Installing Health Center Where to find more information Questions and Answers
SHARE Denver
2 of 24
Introducing Health Center
Live monitoring tool with very low overhead for IBM® Java™ 5.0 and 6.0 Gives insight into how your application is behaving Delivers set-up and tuning recommendations to help avoid application problems Not specific to a particular product or application
SHARE Denver
3 of 24
Introducing Health Center (2)
Client (installed in the IBM Support Assistant) makes a network connection to the agent Agent must be installed into your JVM and enabled with a commandline option
SHARE Denver
4 of 24
Supported platforms
Enabled for all platforms supported by IBM Java 5.0 and IBM Java 6.0 (excluding Solaris and HP) Health Center provides monitoring of
IBM Java 5.0 SR8 and above IBM Java 6.0 SR1 and above
Optimum performance with latest levels
IBM Java 5.0 SR10 IBM Java 6.0 SR5 Removes need for manual log file management Significant improvement in native memory usage
SHARE Denver
5 of 24
Class loading
Line density shows classloading frequency
Check for unexpected classloading and shared class cache use SHARE Denver
6 of 24
Environment
Verify exactly which environment variables and system properties are set
Check classpath settings and options which might affect dump outputs
SHARE Denver
7 of 24
Check for non-standard options
Often, systems have ulimit settings which result in truncated dumps being produced
Some options make it harder to detect problems at system startup
SHARE Denver
8 of 24
Garbage Collection
Visualize garbage collection (GC) to spot trends and catch problems before they occur
Get recommendations about GC policies and heap sizes
Check GC rate and time statistics
SHARE Denver
9 of 24
Detect memory leaks early
An app suddenly receives extra load and starts to use more memory
Health Center warns that you really need to check this isn't a memory leak!
SHARE Denver
10 of 24
Check GC performance
What's the problem? Application throughput, or responsiveness? Low mean pause time – GC probably not the cause of any unresponsiveness
High percentage of time spent paused – 40%...
...but also a high rate of garbage collection. Do I expect to be generating this much garbage?
11 of 24
SHARE Denver
Locking
Check for locks that might prevent your application from scaling
Detailed information about each lock's usage
SHARE Denver
12 of 24
Identify lock contention
Orange or red colour indicates most of the attempts to synchronize were blocked
High average hold time indicates we're holding the lock a long time – doing too much work in it?
Tall bar indicates a large number of requests were blocked
SHARE Denver
13 of 24
Profiling
Self: time spent in this method
Tree: time spent in this method and methods it called
Low-overhead sampling profiler shows which Java code is hottest
Dig deeper into the data to optimize the most common code paths
See which code branches are run most often
SHARE Denver
14 of 24
Identify a method causing poor performance
Do any methods stand out as particularly hot?
Do I expect my application to be primarily doing regex pattern compilation?
Need to either make Pattern.compile() more efficient or call it less
Which methods are calling Pattern.compile? Could I optimize to call Pattern.compile less? SHARE Denver
15 of 24
Identify a method causing poor performance (2)
private String findScreenName(String line) { Pattern p = Pattern.compile("\\s*(.*).*"); Matcher m = p.matcher(line); if (m.matches()) { return m.group(1); } return null; }
Aha – looks like we could cache this compiled pattern
Caching the Pattern halved the amount of time taken to run through the data
Now we have a new hottest method!
SHARE Denver
16 of 24
Sharing data with other experts
Provides data export to save the raw data from the JVM in a compressed file After importing the data, users can zoom and drill down to see the same detail as when the data was collected
SHARE Denver
17 of 24
Installing the Health Center client
Detailed instructions on developerWorks (link in a couple of slides' time). Download the ISA Serviceability Workbench from http://www.ibm.com/software/support/isa/ Use the Update menu to find a new tools add-on Health Center is installed as a tools add-on for analysing problems. Watch the YouTube video if you get stuck!
SHARE Denver
18 of 24
Installing the Health Center agent
For the client to connect, an agent must be installed and enabled in the JVM you want to monitor. The agent is supplied as a zip/pax file which is unzipped into your SDK or JRE's install directory Newer Java versions (6.0 SR4, 5.0 SR9 onwards) already have an agent but you might want to upgrade. Start the application with the appropriate option Watch the YouTube video if you get stuck!
SHARE Denver
19 of 24
Where to find more information
Health Center page on developerWorks
http://www.ibm.com/developerworks/java/jdk/tools/healthcenter/
YouTube videos
http://www.youtube.com/watch?v=5Tcktcl0qxs (overview) http://www.youtube.com/watch?v=6WjE9U0jvEk (client install) http://www.youtube.com/watch?v=Hdp0mJ13NLQ (agent install)
Forum
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1461
Email javatool@uk.ibm.com
SHARE Denver
20 of 24
Popular ISA Plugins
GCMV
Garbage Collection and Memory Visualizer Uses verbosegc trace as input
MDD4J
Memory Dump Diagnostic for Java Uses Portable Heap Dump (.phd) as input
PMAT
Pattern Modelling and Analysis Tool Uses verbosegc trace as input
SHARE Denver
21 of 24
Additional WebSphere Product Resources
Discover the latest trends in WebSphere Technology and implementation, participate in technically-focused briefings, webcasts and podcasts at: http://www.ibm.com/ developerworks/websphere/community/ Learn about other upcoming webcasts, conferences and events: http://www.ibm.com/ software/websphere/events_1.html Join the Global WebSphere User Group Community: http://www.websphere.org Access key product show-me demos and tutorials by visiting IBM Education Assistant: http://www.ibm.com/software/info/education/assistant View a webcast replay with step-by-step instructions for using the Service Request (SR) tool for submitting problems electronically: http://www.ibm.com/software/websphere/ support/d2w.html Sign up to receive weekly technical My Notifications emails: http://www.ibm.com/software/ support/einfo.html
SHARE Denver
22 of 24
IBM Support Wants to Hear From You!
Tell us about your support needs and wants
1. Visit any product support pages on IBM.com. 2. Click on “Participate in Questionnaire” on top right of page. 3. Takes 5-10 minutes to complete.
Or go to https://www.ibm.com/survey/oid/wsb.dll/s/ag21f?wsb34=swg_user
23 of 24
Questions and Answers
SHARE Denver
24 of 24