Eclipse Visualization and Performance Monitoring



Similar documents
Instrumentation Software Profiling

THE BUSY DEVELOPER'S GUIDE TO JVM TROUBLESHOOTING

Trace-Based and Sample-Based Profiling in Rational Application Developer

CSCI E 98: Managed Environments for the Execution of Programs

WebSphere Architect (Performance and Monitoring) 2011 IBM Corporation

Tool - 1: Health Center

Practical Performance Understanding the Performance of Your Application

Effective Java Programming. measurement as the basis

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

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

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

Development Environment and Tools for Java. Brian Hughes IBM

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

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

Zing Vision. Answering your toughest production Java performance questions

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

2015 ej-technologies GmbH. All rights reserved. JProfiler Manual

Effective Java Programming. efficient software development

Rational Application Developer Performance Tips Introduction

Memory Profiling using Visual VM

Enterprise Manager Performance Tips

Monitoring, Tracing, Debugging (Under Construction)

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

Java Troubleshooting and Performance

Validating Java for Safety-Critical Applications

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

Jonathan Worthington Scarborough Linux User Group

CSE 403. Performance Profiling Marty Stepp

What s Cool in the SAP JVM (CON3243)

Oracle JRockit Mission Control Overview

NetBeans Profiler is an

Java Performance. Adrian Dozsa TM-JUG

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Java VM monitoring and the Health Center API. William Smith

Replication on Virtual Machines

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

PTC System Monitor Solution Training

02 B The Java Virtual Machine

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

Java Application Development using Eclipse. Jezz Kelway Java Technology Centre, z/os Service IBM Hursley Park Labs, United Kingdom

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

Java Garbage Collection Basics

Extreme Performance with Java

Whitepaper: performance of SqlBulkCopy

Eclipse 4 RCP application Development COURSE OUTLINE

Web Development with the Eclipse Platform

Using Power to Improve C Programming Education

Java Virtual Machine: the key for accurated memory prefetching

10 Tips for Optimizing the Performance of your Web Intelligence Reports. Jonathan Brown - SAP SESSION CODE: 0902

For Introduction to Java Programming, 5E By Y. Daniel Liang

Clojure and Android. Daniel Solano Gómez. Clojure/conj Sattvik Software & Technology Resources, Ltd. Co.

Object Instance Profiling

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

Fundamentals of Java Programming

PHP vs. Java. In this paper, I am not discussing following two issues since each is currently hotly debated in various communities:

enterprise professional expertise distilled

Performance Measurement of Dynamically Compiled Java Executions

Mobile Application Development Android

ARM-BASED PERFORMANCE MONITORING FOR THE ECLIPSE PLATFORM

Monitoring Java enviroment / applications

Performance Tools for Parallel Java Environments

Tomcat Tuning. Mark Thomas April 2009

Physical Data Organization

14/05/2013 Ed Merks EDL V1.0 1

The Fundamentals of Tuning OpenJDK

Lua as a business logic language in high load application. Ilya Martynov ilya@iponweb.net CTO at IPONWEB

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

WHITE PAPER Application Performance Management. A Practical Approach to Balancing Application Performance and J2EE Instrumentation Information

All Your Code Belongs To Us Dismantling Android Secrets With CodeInspect. Steven Arzt Secure Software Engineering Group Steven Arzt 1

Monitoring and Managing a JVM

Using and Extending the Test and Performance Tools Platform (TPTP)

Tech Tip: Understanding Server Memory Counters

Computing Concepts with Java Essentials

ELEC 377. Operating Systems. Week 1 Class 3

6. Storage and File Structures

PC Based Escape Analysis in the Java Virtual Machine

1/20/2016 INTRODUCTION

Virtual Machine Learning: Thinking Like a Computer Architect

Developing Eclipse Plug-ins* Learning Objectives. Any Eclipse product is composed of plug-ins

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Oracle Corporation Proprietary and Confidential

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

Course MS10975A Introduction to Programming. Length: 5 Days

Semester Thesis Traffic Monitoring in Sensor Networks

HPC ABDS: The Case for an Integrating Apache Big Data Stack

Lecture 1 Introduction to Android

Enterprise Mobile Application Development: Native or Hybrid?

Efficient Monitoring of OSGi Applications

Understanding the Performance of the Java Operating System JX using Visualization Techniques

Java EE Web Development Course Program

General Introduction

JProfiler: Code Coverage Analysis Tool for OMP Project

Evidence based performance tuning of

Java-based web-apps with the Rich Ajax Platform (RAP)

Tutorial 5: Developing Java applications

Advanced Performance Forensics

Garbage Collection in the Java HotSpot Virtual Machine

Quick Start Guide.

Transcription:

Eclipse Visualization and Performance Monitoring Chris Laffra IBM Ottawa Labs http://eclipsefaq.org/chris Chris Laffra Eclipse Visualization and Performance Monitoring Page 1

Roadmap Introduction Introspection Java Spider Visualization Profiling Conclusions Chris Laffra Eclipse Visualization and Performance Monitoring Page 2

Introduction Eclipse is a massive framework Learning curve may be steep How to make sense from 100s of plug-ins Key to understanding performance are insights into operating systems, Java language, and all constructs above Management of limited resources Chris Laffra Eclipse Visualization and Performance Monitoring Page 3

Eclipse Concepts Chris Laffra Eclipse Visualization and Performance Monitoring Page 4

Introspection To find out what happens in Eclipse, use: The platform core tools: www.developerworks.ibm.com search for Kehn A debugger and step into and over methods Insert System.out.println() calls A Java profiler based on JVMPI JProbe/Yourkit/Hyades/XRay, etc. A tool/classloader that instruments bytecodes AOSD: weave in a concern Eclipse monitor based on JikesBT (IBM alphaworks) Chris Laffra Eclipse Visualization and Performance Monitoring Page 5

Part of Eclipse core Tools Inspect Eclipse: Runtime Spy Shows Plug-in Load order Chris Laffra Eclipse Visualization and Performance Monitoring Page 6

Inspect Eclipse: Java Spider Written by Erich Gamma and Kent Beck http://www.javaspider.org Chris Laffra Eclipse Visualization and Performance Monitoring Page 7

Profiling: JVMPI and JVMTI JVMPI Java VM Profiling Interface VM runs slower less aggressive JIT Must be able to generate events on demand JVMPI agent can turn on/off any event at will Makes VM design less clean JVMTI Java VM Testing Interface Uses bytecode instrumentation done by VM Choose ahead of time what you want to trace Clean VM design May completely confuse JIT Chris Laffra Eclipse Visualization and Performance Monitoring Page 8

The Cost of Profiling All profiling processes are intrusive JVMPI reduces JIT and may completely change the behavior of the target Instrumentation can be equally distorting Sampling technique are less intrusive, but provide only hot spots and have a hard time to provide call hierarchies, etc. Summary: use profiler output only as a hint to start looking at trouble spots Chris Laffra Eclipse Visualization and Performance Monitoring Page 9

Profiling Eclipse: Products OptimizeIt Quantify JProbe Yourkit Chris Laffra Eclipse Visualization and Performance Monitoring Page 10

Profiling Eclipse: Open Source Eclipse Profiler (SourceForge) EJP (SourceForge) Hyades (Eclipse project) Chris Laffra Eclipse Visualization and Performance Monitoring Page 11

Profiling Eclipse: XRay Modeled after Task Manager Low Overhead Enabling Daily Use Show Indicators in one Single Graph, Allow Human Brain to Observe Patterns Generate Reports with Screendumps Chris Laffra Eclipse Visualization and Performance Monitoring Page 12

XRay: Vital Statistics CPU% of process Heap Use in MB Disk Read and Write Windows Handles Burn Rate in MB/s Combined Graph Showing CPU, burn rate, Disk I/O, Plugin Load, GC, and Total Live Objects Thread View Showing Activity Per Thread If It did Something in the second shown Report Area Showing Details when a time slot is selected in main Graph Chris Laffra Eclipse Visualization and Performance Monitoring Page 13

XRay: Plug-in Profiling 1. Browse top-down or bottom-up 1 2 3 4 2. Move focus from Plugins to methods 3. Find Hot Plug-ins 4. Find Hot Callers 7 Chris Laffra Eclipse Visualization and Performance Monitoring Page 14

XRay: Plug-in Profiling Data sorted on a plug-in level so a user can more easily identify their code Two modes of drilling down: Find out for a given plug-in who is calling you Find out all the plug-ins called by your plug-in Search methods by name and top 1000 Data: CPU time, #calls, #news, #classloads, bytes read, bytes written Chris Laffra Eclipse Visualization and Performance Monitoring Page 15

XRay: Comparing 2 Runs Visual differentiation cues Filtration mechanism Concrete relative figures Chris Laffra Eclipse Visualization and Performance Monitoring Page 16

XRay: Finding Methods Enter ActionSet Finds all methods and sorts by CPU Clicking on a result to show method in Profile Tree and Method Details. Chris Laffra Eclipse Visualization and Performance Monitoring Page 17

XRay Example: 1. 2. 3. 1. Load empty workbench 2. Switch to Java Perspective (first time) 3. Create a new Project (first project). This triggers Java indexing and types caching (reads rt.jar) Chris Laffra Eclipse Visualization and Performance Monitoring Page 18

Visualization Experience has shown that best technique is to use bytecode instrumentation Approach is special classloader that takes bytecodes and inserts extra code Could use BCEL, JikesBT, or other tools Need to cache the result to improve startup time for future runs May need a process to instrument all Eclipse Chris Laffra Eclipse Visualization and Performance Monitoring Page 19

JikesBT Quick Overview Bytecode represented as a graph Makes it very easy to add calls anywhere Expensive process, explodes class file into complex Java structure with many Strings Chris Laffra Eclipse Visualization and Performance Monitoring Page 20

Interesting Events? Entering a method Value of method parameters Creation of new objects Call to a method which is known to be outside of instrumented code Leaving a method (with return value) Chris Laffra Eclipse Visualization and Performance Monitoring Page 21

Applet Dashboard Example Hijack the IE AppletClassloader Add ability to suspend, kill, trace, and rehost them Weave in concern to detect network access Chris Laffra Eclipse Visualization and Performance Monitoring Page 22

Domain-specific Visualization Take a model and add a new view by adding a new concern Good: Does not complicate original code Allows for specialized representations and control Chris Laffra Eclipse Visualization and Performance Monitoring Page 23

Howto: Eclipse Visualization Adding visualization to Eclipse: Add a new OSGi adaptor to Eclipse Overload the defineclass method: Obtain instrumented code from cache, or Use bytecode instrumentation Call super.defineclass on the result Implement runtime loaded by bootloader Connect visualizer to runtime Chris Laffra Eclipse Visualization and Performance Monitoring Page 24

Eclipse Visualization Showing Plug-ins when they are loaded Indicate activity and interaction between plug-ins Light-weight, little overhead Allows for drilling down into specific plug-ins Chris Laffra Eclipse Visualization and Performance Monitoring Page 25

Eclipse Visualization 1. Filter plug-ins to show methods traces 2. See time stamps 3. Method names 4. Argument values 5. Call to other plug-ins 6. Object creation 7. Return values Chris Laffra Eclipse Visualization and Performance Monitoring Page 26

Eclipse Visualization Inspect the entire Java heap See what plug-in objects are created and when Inspect values Find memory leaks Chris Laffra Eclipse Visualization and Performance Monitoring Page 27

Eclipse Visualization Simple extension point and wizard allow for custom visualization. 2 samples: Profiler and Eclipse Disco Chris Laffra Eclipse Visualization and Performance Monitoring Page 28

Performance Tips Use the right tools: Profiler, instrumentation, or System.out Be Lazy: Avoid touching plug-ins, classes and static initializers (avoid class loading) Avoid doing things until you really have to Some things are much slower than others Don t go overboard (use 90/10 rule & focus) Most importantly: Don t over-generalize!!! Chris Laffra Eclipse Visualization and Performance Monitoring Page 29

Slow Things in Eclipse/Java Bad Algorithms. Linear Algorithms. Deep recursion (due to Java stack) Things like Hashtable/Vector (synchronized). Use HashMap/ArrayList instead Class Loading and Initialization Lots of object creation/garbage collection I/O (buffer your reading/writing). Always test on a cold disk. Chris Laffra Eclipse Visualization and Performance Monitoring Page 30

Slow Things in Eclipse/Java Method calls (compared to Field access) Flexible, object-oriented architectures (do you really need that design pattern here?) JNI calls (calling them, not running them) Complex UIs (avoid multiple refreshes) GEF is known for deeply recursive layout Too many threads Chris Laffra Eclipse Visualization and Performance Monitoring Page 31

Fast Things in Eclipse/Java Local variables, fields, loops, arrays Exception clauses (try-catch) Small code Running JNI calls or native (AOT) code Native widgets (think SWT vs. Swing) Anything that avoids class loading (plug-in activation, and disk access) Fastest code is code that is not executed Chris Laffra Eclipse Visualization and Performance Monitoring Page 32

Final Wise Words Simplicity and elegance are unpopular because they require hard work and discipline to achieve and education to be appreciated. -- Edsger Dijkstra Chris Laffra Eclipse Visualization and Performance Monitoring Page 33

References http://eclipse.org http://eclipsefaq.org Chris Laffra Eclipse Visualization and Performance Monitoring Page 34