profiling java applications using eclipse* test and performance tools platform
DESCRIPTION
Profiling Java applications using Eclipse* Test and Performance Tools Platform. Instructors. Mikhail Voronin Intel Corporation [email protected] Alexander Alexeev Intel Corporation TPTP Committer [email protected]. Agenda. Unit 1 – Eclipse* TPTP Overview - PowerPoint PPT PresentationTRANSCRIPT
© 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0 | February, 2008 |
Eclipse* TPTP Project
Profiling Java applications using Eclipse* Test and Performance Tools Platform
2 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Instructors
Mikhail Voronin
Intel Corporation
Alexander Alexeev
Intel CorporationTPTP Committer
3 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Agenda
Unit 1 – Eclipse* TPTP OverviewUnit 2 – Using the TPTP Java Profiler
Profiler Architecture Profiling and Logging Perspective Launch and Attach Profiling options and views Demo Profiler Preferences
Conclusion, Opens and Limitations
4 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Participants
Tell me a little about yourselves…
From where Company or academic institution Users or Adopters Eclipse* and TPTP experience Java* experience Have you used a Java* profiler before? Tutorial expectations
5 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Unit 1 – Eclipse* TPTP OverviewUnit 2 – Using the TPTP Java Profiler
Profiler Architecture Profiling and Logging Perspective Launch and Attach Profiling options and views Demo Integration with BIRT Profiler Preferences
Conclusion, Opens and Limitations
6 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Eclipse* TPTP Overview Eclipse* Tools Project, Hyades, Dec 2002
Promoted to Eclipse* project, 2005
Open-source platform for Automated Software Quality (ASQ) tools including reference implementations for testing, tracing and monitoring software systems
Addresses the entire test and performance life cycle, from early testing to production application monitoring, including test recording, editing and execution, monitoring, tracing and profiling, and log analysis capabilities
Integration with tools used in the other processes of a software lifecycle under Eclipse* environment
Reduce the cost and complexity of implementing effective automated software quality control processes
Share data through an OMG-defined trace, log, statistical and test model implemented via the Eclipse* Modeling Framework (EMF)
Active participants:IBM, Intel(R), OC Systems
Former participants:Compuware, SAP, Scapa Technologies
7 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Eclipse* TPTP Overview
Composed of 4 sub projects: Platform
Test
Trace and Profiling
Monitoring Principles:
Extension of the Eclipse* Value Proposition
Vendor Ecosystem
Vendor Neutrality
Standards-Based Innovation
Agile Development
Inclusiveness & Diversity TPTP is highly extensible.
8 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Presentation System
Test
Trace
EMF Data Models
Log
StatisticalXMI
Real TimeExport
Runtim
eM
onitor / log
Trace Analysis
And Profiling
Test Creation
and Execution
Artifact
Managem
ent
Eclipse* TPTP GUI
Standard Widgets andCore Plug-ins
Reference PerspectivesAnd Workflow
Target System
Data C
ollectionApplication
Data C
ollectionInterface
InjectionCorrelation
ExecutionEnvironment
Log Collection
Trace Collection
System PerformanceMonitor
JVMPI Monitor
Data Loader
DistributedData Collection
Framework
Agent
Control Interface
Agent
Control Interface
DistributedControl
Framework
Testability Interface
Test Engine
TPTP Architecture
Eclipse* Platform
JVMTI Monitor
9 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Eclipse* TPTP Profiling Tool Overview
Broadly useful for performance analysis and for gaining a deeper understanding of a Java* program
Consists of the Profiling and Logging Perspective and a number of graphical and tabular views
Visualize program execution and threading behavior; Pinpoints operations that taking most resources; Explore patterns of program behavior
Enables you to test your application's performance early in the programming development cycle for improvements
Option to run application with agent at near full speed (enabled mode) and attach to it to gathering details at certain phase.
Assorted filtering functionality which can help to localize problem and reduce overhead for large long run applications
10 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Eclipse* TPTP Agent Controller Overview
A daemon process that resides on each deployment host and enables client applications to launch host processes and interact with agents that coexist within host processes
Contains a server that has the capability to launch and manage local or remote applications from a local TPTP workbench
The Java* profiler is a managed agent that can be used to profile local or remote Java* applications from a local TPTP workbench
11 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
JVMTI-based Java* Profiler vs. JVMPI-based
Java* 5.0 has introduced new standards for profiling Prior to Java* 5.0 (Java* 1.4-) the standards and the interfaces to support
profiling (JVMPI) were experimental
Java* J2SE 6 eliminated JVMPI interface The new standard (JVMTI) is an innovative solution to profiling and enables
you control precisely which parts of an application are profiled
Eclipse* TPTP has embraced this innovation and the new Java* profiler is based on this new standard
In Eclipse* TPTP old Java* profiler (JVMPI) still exists Only for backward compatibility with Java* 1.4 Because of JVMPI/JVMTI interface differences there are some differences
in behavior between old and new profiler Old Java* profiler will eventually be removed from Eclipse* TPTP
12 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Unit 1 – Eclipse* TPTP OverviewUnit 2 – Using the TPTP Java* Profiler
Profiler Architecture Profiling and Logging Perspective Launch and Attach Profiling options and views Demo Integration with BIRT Profiler Preferences
Conclusion, Opens and Limitations
13 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
JVMTI-based Java* Profiler
A set of libraries that attach to a JVM for recording Java* application's behavior
An extensible framework, consisting of a core runtime component (Martini), an agent managed by the Agent Controller (JPIAgent), and a set of data collection libraries built on top of the Martini runtime.
Can be used to identify performance details such as classes or methods responsible for execution bottlenecks, analyze application heap to find memory leaks and visualize threading behavior.
Output in the form of XML fragments (XML4Profiling) Can be launched from the Eclipse* IDE or as a standalone
program using JVM command-line options Applications under test can reside in Eclipse* workspace,
binaries on file system, or hosted in a J2EE application server.
14 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
JVMTI-based Java* Profiler Architecture
Presentation System(Eclipse* Workbench)
Application Under Test (Java* Virtual Machine)
DistributedControl and
Data CollectionFramework
Agent Control and Data Collection
module (JPIAgent)
Martini Framework for Java*
Java* Virtual Machine Tools Interface (JVMTI)
Martini-based Data Collectors
Call Graph(CGProf)
Heap(HeapProf)
Thread(ThreadProf)
15 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Profiling and Logging Perspective
Profiling and Logging perspective provides resources for starting a profiling session as well as obtaining comprehensive information on the performance of the monitored application
The profiling tool provides information pertaining to Execution analysis
Method execution performance
Object allocations
Thread interactions
16 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Profiling and Logging Perspective
Combinations of views and editors that are best suited to perform application profiling
Profiling Monitor view Administrate profiling resources and manage activities
Profiling views Visualize and analyze profiling data
Profiling actions Control profiling resources
Actions are resource sensitive
Choice of action depending on type and status of the object in selection Attach and Detach the agent from process Start and Stop monitoring on an agent Terminate a process
17 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Open view actions
Monitor and Navigator view Profiling views
View level actionsMonitor actions
18 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Host: system under profile
Process: application under profile
Profiling Agent & Analysis types
19 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach
Profiling session is started by launching an application or by attaching to a running application
Launch : start an application with a profiling agent
Attach : attach to an application which is already started and invoked with a profiling agent
How? Launch configuration is where you start the session.
20 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach - Configuration A place to create, run and manage profiling
sessions.
Configure the details of a profiling session Target host
Application to profile
Scope of the profile
Profile data destination
Select launch configuration type according to the location of the target Java* application:
Within Workbench > “Java Application” launch configuration
Outside Workbench > “External Java Application” launch configuration
21 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Configuration Tabs
Collect and display detail information about a configuration
Tabs for profiling: Monitor tab : defines detail of data collection on a profiling session
Destination tab : defines the destination of the profiling data
Host tab : for external application configurations only, defines the location of process to be launched or attached
Agents tab : for attach configurations only, lists agents available for attach
22 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Monitor Tab
Data Collectors
Analysis Types
23 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Profiling Options
24 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Profiling Options – Filter Set
Limit the scope of a profiling session
Ensure that only relevant details are collected
Especially useful when speed and efficiency is critical
Excluded classes and methods are not instrumented and execute in full speed
Only the first applicable filter is applied. When you are specifying filters, ensure that you declare the most specific filter criteria first
25 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Execution Analysis Options
26 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Execution Time Analysis Options
Specifies the type of information to collect during execution time analysis
Use the “Show execution statistics” option to identify the most time-consuming methods
Low-overhead. Can be used without extensive filtering
Use the “Show execution flow graphical details” option to identify the relationships between executing methods (call-tree).
High-overhead. Filtering is recommended.
27 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Memory Analysis Options
28 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Memory Analysis Options
Specifies the type of information to collect during memory analysis
Use the “Track object allocation sites” option to identify the source line where each object is allocated
May slightly increase analysis overhead
29 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Launch and Attach – Destination Tab
Specify the destination of the profile data Workbench : Visualize and analyze in profiling views (default)
File : export to XML file, available for import.
Import profiling file File > Import ... > Profiling file
30 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Profiling an External Application – Host Tab
31 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Attaching to a Running Application – Monitor Tab
32 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Profiling Views
A collection of views to visualize and analyze profiling data Memory Statistic view (tabular)
Execution Statistic view (tabular)
Coverage Statistic view (tabular)
Method Invocation Detail view (tabular)
Execution Flow view and table (graphical + tabular)
Method Invocation view and table (graphical + tabular)
Execution Call Tree (graphical + tabular)
UML2 Trace Interactions view (graphical)
33 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Recommendations for effective profiling
Using filters to collect only needed data
Pause/resume to select activities to profile
Attach/Detach to eliminate overhead when we don’t profile
34 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
A few words on filtering in TPTP Collection Time Filtering
Pro: Reduce data volume and instrumentation overhead (critical)
Con: Data for excluded classes/method can never be seen Model Import Filtering
Pro: Reduce workbench memory footprint (critical on 32bit OSes)
Con: Can only see data that is in the model View Level Filtering
Pro: Remove items from being visualized in the workbench
Con: Does not reduce data volume or model footprint
35 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Access to Attach/Detach and Pause/Resume
Pause
Resume
Detach
Attach
36 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Java* Profiling - Demo
Profiling a local Java* application Execution Time Analysis
Memory Analysis
Thread Analysis
Profiling an External Java* Application
Profiling an Eclipse* Plugin (RCP Application)
Profiling a J2EE (Server) Application
37 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Java* Profiling - Preference
Dialog to set user preference
Window > Preferences...
Set default profiling values
Add host
Configure view preferences
38 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Java* Profiling - Attach
Start application under profile in standalone mode Invoke the Java* Profiling Agent, a library that attaches to a Java* virtual
machine (JVM) to capture and record the behavior of the Java* application
Use the -agentlib JVM option to invoke the Java* Profiling Agent: -agentlib:JPIBootLoader=JPIAgent:server=enabled;{profiler}
Communication with the agent invoked is done using a client workbench by means of the Agent Controller on the host machine.
Attach to the agent : Profile Configuration... > Attach to Agent
39 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Unit 1 – Eclipse* TPTP OverviewUnit 2 – Using the TPTP Java* Profiler
Profiler Architecture Profiling and Logging Perspective Launch and Attach Profiling options and views Demo Integration with BIRT Profiler Preferences
Conclusion, Opens and Limitations
40 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
TPTP Profiler FutureUpdates for Ganymede Improve overall usability via assorted fixes
Using feedback from users Reduce usability diffs between JVMPI and JVMTI…
e.g., SSL for secure communicationse.g., Reduce overuse of dynamic attach/detach
Enhancementse.g., Better multithread analysis
Improved visualizationContended lock analysisTrack more thread states (e.g., join points)
e.g., Efficient binary transfer formate.g., Better Java* 6 support
Long-term JVM Heap analysis and trends Object reference analysis Graphic representation of profiling data and JVM telemetry
41 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Resources
TPTP (Documentation, Download, CVS, Newsgroups, mailing list,etc..)http://www.eclipse.org/tptp/
TPTP Online Helphttp://help.eclipse.org/
42 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Q & A
43 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
TPTP @ EclipseCon2008
Short Tutorials (2 hours)Profiling Java* applications using Eclipse* TPTP
Alexander Alexeev, Mikhail Voronin, Monday, 08:00, Great America Meeting Room 1
Long Talk (50 mins)A Harmonious Combo : Experiences Profiling Apache* Harmony with Eclipse* TPTP
Chris Elford, Sergey Kuksenko, Thursday, 14:30, Grand Ballroom C
Functional Testing with the Eclipse* TPTP ProjectEric Long, Tuesday, 14:30, Room 206
Extending TPTP for database unit testingWei Liu, Der Ping Chou, Hong-Lee Yu, Don Clare, Thursday, 13:30, Theatre
Short Talk (10 mins)Extending TPTP for TTCN-3.
Paul Slauenwhite, Wednesday, 15:30, Room 209/210
44 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
45 Profiling Java* applications using Eclipse* TPTP | © 2008 IBM Corporation and Intel Corporation; made available under the EPL v1.0
Eclipse* TPTP Project
Legal Notices:
Other company, product, or service names may be trademarks or service marks of others.