Download presentation
Presentation is loading. Please wait.
Published byClarence Johns Modified over 9 years ago
1
Page 1 © 2001 Hewlett-Packard Company Tools for Measuring System and Application Performance Introduction GlancePlus Introduction Glance Motif Glance Character Mode Glance Command-line Xverbosegc HPjmeter and –Xeprof Other Tools
2
Page 2 © 2001 Hewlett-Packard Company HPjmeter Understanding Your Java Application’s Performance
3
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 3 HPjmeter Free and Easy to Use Analyzes Java application performance Graphical Free Runs on any platform http://www.hpjmeter.com/
4
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 4 HPjmeter How To Collect Metrics HPjmeter java.eprof java.prof java.hprof.txt 1.1 Java 1.1.x JVMPI+ (HP-UX) Java 1.1.8+ Java 1.2.2.05+ Java 1.3.x JVMPI Java 1.2.1-A and compatible Java 1.3.0-C and compatible
5
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 5 HPjmeter JVMPI Options Options to use to any JVM: cpu=samples,thread=y,depth=10,cutoff=0,format=a heap=all,cpu=samples,thread=y,depth=10,cutoff=0,format=a monitor=y,cpu=samples,thread=y,depth=10,cutoff=0,format=a A support matrix for the features you need is online and in Help
6
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 6 HPjmeter JVMPI - Xrunhprof hprof usage: -Xrunhprof[:help]|[ =,...] Option Name/Value Description Default --------------------- ----------- ------- heap=dump|sites|all heap profiling all cpu=samples|times|oldCPU usage off monitor=y|n monitor contention n format=a|b ascii or binary outputa file= write data to file java.hprof(.txt) net= : send data over a socketwrite to file
7
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 7 hprof usage: -Xrunhprof[:help]|[ =,...] Option Name and Value Description Default --------------------- ----------- ------- depth= stack trace depth 4 cutoff= output cutoff point 0.0001 lineno=y|n line number in traces? y thread=y|n thread in traces? n doe=y|n dump on exit? y Example: java -Xrunhprof:cpu=samples,file=log.txt,depth=3 FooClass HPjmeter JVMPI - Xrunhprof
8
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 8 HPjmeter Enhanced Profiling for HP-UX Profiling option for HotSpot -Xeprof:help Collects CPU time separately per thread Very low intrusion
9
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 9 HPjmeter HP JVM’s -Xeprof Option Options to use for HP’s JVM: -Xeprof:file=java.$$.eprof Specify the $$ in the script with the java command to include the Process Identifier in the name and ensure files are not overwritten
10
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 10 HPjmeter SPEC JVM 98 Benchmark Low Intrusion! Faster than Classic
11
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 11 HPjmeter Elapsed (Wall Clock) and CPU Time Inclusive and Exclusive times Methods Classes Process Thread Call Graph Tree form Call hierarchy navigation Ability to find callers quickly!
12
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 12 HPjmeter Object Creation Allocated Objects Residual Objects Location in code where created Reference Graph –Tree form –Ability to find referencing objects
13
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 13 HPjmeter HP JVM’s -Xeprof Option Options to use for HP’s JVM: -Xeprof:file=java.$$.eprof Specify the $$ in the script with the java command to include the Process Identifier in the name and ensure files are not overwritten
14
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 14
15
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 15 Help: User’s Guide
16
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 16 How to run HPjmeter
17
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 17 Measure Object Creation
18
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 18 File: Open
19
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 19
20
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 20 Select File to Open
21
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 21 Open
22
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 22 Reading Thread Data
23
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 23 Creating Internal Data Structures
24
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 24 Program Information Elapsed Time Number of Methods Threads
25
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 25 Where’s the Time Going? CPU bound application Find method consuming highest amount of time Find location in call chain
26
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 26 Metrics
27
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 27 Exclusive Method Time (CPU)
28
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 28 Sorted in Decreasing Order
29
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 29 Select Highest
30
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 30 Mark Selected Item to Find
31
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 31 Switch to Call Tree
32
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 32
33
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 33 Find Selected Item Immediately
34
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 34 Automatic Expansion Double-click for All Callers
35
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 35
36
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 36 Overloaded Methods Distinguish by Parameters
37
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 37 View:Arguments
38
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 38
39
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 39
40
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 40 Arguments Displayed
41
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 41 1. Select 2. Mark to Find
42
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 42 Find Immediately
43
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 43
44
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 44 Exceptions Bad programming practice to use as: Terminators for searches Indicators of a frequent exception condition HPjmeter makes them easy to find Guess:Exceptions Thrown
45
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 45 Guess:Exceptions Thrown
46
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 46
47
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 47
48
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 48 Select Highest
49
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 49 Mark to Find
50
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 50 Switch to: Call Graph Call Count
51
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 51 Find Immediately
52
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 52 Automatic Expansion Find Called Methods
53
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 53 Click on “o->” to Expand
54
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 54
55
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 55
56
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 56
57
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 57 Double-click for All Callers
58
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 58
59
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 59 Start new search: Tree:Collapse All
60
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 60 Select Next Highest
61
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 61 What Exceptions?
62
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 62 Expand
63
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 63 Empty Stack Exception!
64
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 64 Select Next Highest
65
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 65
66
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 66 Empty Stack Exception!
67
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 67 Investigate Others: Date
68
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 68 Illegal Argument Exception!
69
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 69 HPjmeter Threads Thread Lifetimes Thread states - CPU, I/O, Waiting, GC,... Color coded to emphasize important performance characteristics Distribution over lifetime Visualize thread starvation Sort Thread Histogram by: Birth time of thread Heuristic based on each thread’s metrics CPU time used by method in Find pop-up
70
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 70 Threads Histogram
71
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 71
72
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 72 Double-click for Pie Chart
73
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 73 Massive Lock Contention!
74
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 74
75
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 75 HPjmeter Java Application Monitor Contention Highlights contested Java monitors JDK 1.3.1 – Exact metrics generated for contention Metrics: Lock requests when lock held Per-method time spent waiting for lock
76
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 76 Metric: Total Lock Delay
77
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 77
78
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 78 Mark Selected Item to Find
79
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 79 Display Contents of Find Edit:Find
80
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 80
81
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 81 Threads Histogram More Work Done
82
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 82
83
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 83
84
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 84 Sort by _service()
85
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 85
86
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 86 Switch to Thread View Scope:Thread
87
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 87
88
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 88 Select Thread
89
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 89
90
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 90 Metric: Total Lock Delay
91
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 91 103343 spent in _service()
92
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 92 How much total time spent in _service()? Metric: Exclusive Clock
93
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 93 106989 spent in _service()
94
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 94 97% (103343/106989) spent in waiting for lock in _service()
95
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 95 Save Metric to File
96
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 96
97
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 97
98
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 98 Exclusive Method Time (CPU)
99
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 99
100
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 100
101
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 101
102
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 102
103
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 103
104
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 104
105
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 105
106
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 106
107
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 107
108
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 108 HPjmeter Object Creation Allocated Objects Residual Objects Location in code where created Reference Graph –Tree form –Ability to find referencing objects
109
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 109 HPjmeter Object Creation Created Objects Count with -Xeprof requires either: -Xeprof:inlining=disable or: -Xint -Xeprof Created Objects (Bytes) requires use of the the Classic JVM and hprof: java -classic -Xrunhprof:heap=all,cutoff=0,...
110
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 110
111
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 111
112
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 112
113
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 113
114
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 114
115
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 115
116
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 116
117
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 117
118
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 118
119
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 119 HPjmeter Profile Comparison Compare profile data from two different runs – See impact of – Code modification – Load change – Eliminate start-up noise – Find “memory retention”
120
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 120 HPjmeter Profile Comparison
121
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 121 HPjmeter Profile Comparison More Work Done
122
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 122 HPjmeter Other Features Search Mark and Find Save displayed metrics to a file On-line help
123
Tools for Measuring Performance © 2001 Hewlett-Packard Company Page 123 HPjmeter Contact Info Web links: http://www.hpjmeter.com/ Write to us: java-tools-support@cup.hp.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.