Notes
Slide Show
Outline
1
A Harmonious Combo :
Experiences Profiling
                         with Eclipse* TPTP
  •          Chris Elford -- Intel Corporation
  • Sergey Kuksenko -- Intel Corporation
2
Outline
  • Overall project goals
  • Introduction to Apache* Harmony
  • The Eclipse* TPTP profiler
  • First experiences using TPTP
  • Analysis of advanced workload with TPTP
  • Looking to the future
3
Goals and Methodology of our Experiments
  • Goals
    • Identify Harmony performance opportunities using TPTP
    • Integrate TPTP into our performance methodology
  • Approach
    • Start simple…
      • Verify that we can recognize known performance issues w/ TPTP
      • Understand how opportunities manifest in TPTP
      • Understand current limitations of TPTP and Harmony JVMTI
        • Fix critical issues along the way
    • Grow…
      • Move forward looking for new opportunities to optimize Harmony
      • Use TPTP more regularly
      • Suggest TPTP & Harmony JVMTI enhancements for our use case
4
 
5
Apache* Harmony Overview (continued)
  • Why J2SE 5?
    • “Starting with Java SE 5, as that is the first version of Java SE for which the licensing allows an open source implementation”
    • “Continue with Java SE 6 and any subsequent versions that follow.”


  • Who all is using Apache* Harmony technology?
    • Since its an open license, we don’t know for sure…  but to name a few
        • http://mail-archives.apache.org/mod_mbox/harmony-dev/200712.mbox/%3c4759E2CD.5010308@gmail.com%3e
        • http://mail-archives.apache.org/mod_mbox/harmony-dev/200711.mbox/%3c8084e12c0711201546m7e3cc028kf5df2763df708fd3@mail.gmail.com%3e
6
A Brief History of Apache* Harmony
  • May 2005: Accepted by the ASF and started in Apache* Incubator
  • May 2006: Harmony has VM and classlib functional to run Eclipse* 3.0
  • May 2006: JavaOne - demonstrated functional classlib with Swing/AWT
  • July 2006: First JRE Snapshot Published
  • Oct 2006: Became ASF Top Level Project
  • May 2007: First Milestone Build Released (M1)
  • May 2007: JavaOne – “In Harmony with Eclipse” bundle CDs distributed
  • …
  • Dec 2007: Fourth Milestone Build Released (M4)
  • Feb 2008: Fifth Milestone Build Released (M5)
7
Apache* Harmony: What’s Inside?
  • ~2.3 million LOC
    • ~1.6 million Java* code, ~ 0.7 million C/C++
  • Serious testing and engineering infrastructure
  • Components
    • API: ~99% JDK5, ~90% JDK6
    • Project VMs: DRLVM (and others)
    • Tools: javac, javah, javap, jarsigner, keytool, appletviewer
  • Platform Support
    • Systems with x86 processors supporting Intel® SSE or greater
    • Systems using processors compatible with Intel® EM64T
    • Intel® Itanium®-based systems
  • Operating System Support
    • Several versions of Windows* and Linux
8
Apache* Harmony and Eclipse*: Synergy
  • The Eclipse* platform was the first large application enabled on Harmony back in ’06
  • Harmony test base includes >20 Eclipse* scenarios
    • Harmony performance has been tuned for Eclipse* platform
  • Harmony adopted EUT for daily execution
  • Harmony JVMTI has proven to work with TPTP
    • Harmony adopted key TPTP JVMTI tests for daily execution
  • “In Harmony with Eclipse” bundles updated regularly
    • http://sourceforge.net/projects/eclipse-harmony/
9
Eclipse* TPTP Profiling Tool Overview
10
Obligatory Eclipse* TPTP Architecture Diagram
11
The New Java* Profiler (JVMTI) vs. JVMPI
12
Eclipse* TPTP Profiler Updates for Ganymede
13
 
14
Harmony analysis with TPTP: Startup performance
  • Consider simplest workloads
    • Hello World
    • Startup phase of a GUI application
  • Goal
    • Understand detailed end to end behavior
    • Find inefficiencies in class libraries for optimization
  • Approach
    • Disable default filters in TPTP
    • Collect trace
    • Analyze
  • Discoveries from our first use of TPTP
    • Even for small apps, data volume can be huge w/o filters
    • Several TPTP usability bugs; fixes targeted for Ganymede
    • Xml4profiling lacks command line tool for tsv/csv dumps
15
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
16
Harmony performance analysis w/ TPTP: HWA startup.
17
Harmony perf analysis w/ TPTP: EIOffice startup.
18
More advanced study: SPECjbb* 2005
  • Analyze more complex, long running, workload
    • Snapshot performance during workload steady-state
    • We use SPECjbb* 2005 workload for some of our performance tests
  • Goal
    • Understand application behavior
    • Find inefficiencies in class libraries for optimization

  • Ideal Approach
    • Disable default filters in TPTP, Collect trace, Analyze
      • Would prefer to collect trcxml from our batch scripts then do offline analysis


  • Discoveries from our use of TPTP
    • Can’t get sufficient detail with filtering; w/o filtering; too much data
      • Pause/resume helps… But doesn’t help allow batch mode execution
      • Hope for richer control with Application mode in Ganymede
    • Avoid attach mode
      • Instrumentation during run perturbs performance
19
Performance study: SPECjbb* 2005
20
Performance study: SPECjbb* 2005
21
Performance study: SPECjbb* 2005
22
Performance study: SPECjbb* 2005
23
Performance study: SPECjbb* 2005
24
Performance study: SPECjbb* 2005
25
Performance study: SPECjbb* 2005 – java.math.* (~10%)
26
What to do next to analyze Harmony with TPTP?
  • So now that we’ve tried TPTP, what is next?


  • Use Eclipse TPTP profiler often to improve Harmony
    • Work closely with Eclipse* TPTP developers
      • So they better understand how we use TPTP
  • Use heap profiler
    • Harmony’s memory footprint is fairly large
    • Target smaller heaps (e.g., for J2SE on smaller devices)
    • Already touch tested it
  • Use thread profiler
    • Particularly excited about optimizing multithreaded Java for multicore platforms
    • Already touch tested it
27
Summarizing wish lists for TPTP and Harmony
  • Features we would like to see in TPTP in future
  • Better handling of huge datasets (multi-GB)
  • Simpler and richer batch (scripted) collection
  • Command line data reduction utility (offline analysis)
  • Interface for filtering “easily” inlinable getter/setter methods at collection time


  • Features we would like to see in Harmony in future
  • Fuller JVMTI implementation
    • e.g., RedefineClasses - needed for TPTP dynamic attach/detach
  • Better memory footprint on large Eclipse* scenarios
  • Further tuned Eclipse* workbench startup time
  • Java* J2SE6 support
28
Conclusion
  • Our perspective


  • Apache* Harmony making great progress
  • Eclipse* TPTP allows great Java* code analysis
  • Both projects have opportunities for further enhancement
    • Look forward to future collaboration between Harmony and TPTP

  • What we would like from you


  • Go try Harmony (w/ Eclipse* platform)
    • Tell us about your experience (and feel free to join)
  • Go try Eclipse* TPTP profiler
    • Tell us about your experience (and feel free to join)
29
TPTP Resources (profiling and beyond)
30
Harmony Resources
31
"Intel,"
  • Intel, the Intel logo, Itanium and VTune are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
  • * Other names and brands may be claimed as the property of others.


32
Questions?
33
BACKUP
34
Eclipse* TPTP -- The New 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 Java command-line options
  • Applications under test can reside in Eclipse workspace,  binaries on file system, or hosted in a J2EE application server.
35
Apache* Harmony Status: Overall
  •  API completeness: ~99%
    • Remaining 1% is in Swing as well as spread over all code
  • Non conformant – Sun* is silent on TCK issue.
    • Compatibility is proven by a number of free and commercial apps running on Harmony
  • VM completeness: ~100% (according to the spec)
    • Interpreter, 2 JITs, DPGO
    • Optimized JIT is based on StarJIT – initially tuned to show best performance on Intel® Itanium® processors – has a good large enough set of HLOs
    • Parallel, generational GC with innovative algorithms.
  • Two commercial-quality VMs are working with Harmony classlibs:
    • IBM* J9*
    • BEA* JRockit*
  • Performance is good on server benchmarks, client still needs some attention.
  • Large set of test suites: Unit, VTS (conformance), reliability, stress, performance, etc.
36
How we collected a snapshot w/o filters
  • Configure profiling to save to a file
    • Destination tab in workbench
  • Configure aggregated stats with 3600 second refresh
    • Avoid auto refresh…  Only manual
  • Start the run and immediately pause collection
    • Pause button…  Could not find a way to start paused…
  • Wait until steady state reached
  • Resume collection
  • Wait a few minutes
  • Pause collection
  • Wait for data to come across
  • Terminate
    • Do not save
  • Restart Eclipse
    • Ensures maximum memory available for file import
  • Import from where you saved file in (1).
37
Heap profile: a first try
38
Thread profile: a first try