Dynamic Analysis and Visualizing of Data Structures in Java Programs Presented by Sokhom Pheng (Supervisor: Clark Verbrugge) McGill University February.

Slides:



Advertisements
Similar presentations
Eclipse TPTP TPTP Heap and Thread Profilers High-level Design Rev 1.0 Asaf Yaffe July, 2006.
Advertisements

Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Memory Management Case study (JVM & CLR) KIRAN KUMAR V KIRAN KUMAR V LENIN THUMMALAPALLI LENIN THUMMALAPALLI.
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Object Field Analysis for Heap Space Optimization ISMM 2004 G. Chen, M. Kandemir, N. Vijaykrishnanan and M. J. Irwin The Pennsylvania State University.
Dynamic Shape and Data Structure Analysis in Java Presented by Sokhom Pheng (Supervised by Clark Verbrugge) McGill University October 17 th 2005.
SENG 531: Labs TA: Brad Cossette Office Hours: Monday, Wednesday.
Using Interfaces to Analyze Compositionality Haiyang Zheng and Rachel Zhou EE290N Class Project Presentation Dec. 10, 2004.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Code Generation Professor Yihjia Tsai Tamkang University.
Combining Static and Dynamic Data in Code Visualization David Eng Sable Research Group, McGill University PASTE 2002 Charleston, South Carolina November.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Incremental Path Profiling Kevin Bierhoff and Laura Hiatt Path ProfilingIncremental ApproachExperimental Results Path profiling counts how often each path.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
Run-time Environment and Program Organization
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles C/C++ Emery Berger and Mark Corner University of Massachusetts.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
1 CMSC 132: Object-Oriented Programming II Java Constructs Department of Computer Science University of Maryland, College Park.
Compiler Optimizations for Nondeferred Reference-Counting Garbage Collection Pramod G. Joisha Microsoft Research, Redmond.
1 Memory Model of A Program, Methods Overview l Memory Model of JVM »Method Area »Heap »Stack.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.
Dynamic Purity Analysis for Java Programs Haiying Xu, Christopher J.F. Pickett, Clark Verbrugge School of Computer Science, McGill University PASTE ’07.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
Component-Level Energy Consumption Estimation for Distributed Java-Based Software Systems Sam Malek George Mason University Chiyoung Seo Yahoo! Nenad Medvidovic.
P ARALLEL P ROCESSING I NSTITUTE · F UDAN U NIVERSITY 1.
UPC/SHMEM PAT High-level Design v.1.1 Hung-Hsun Su UPC Group, HCS lab 6/21/2005.
Lecture 10 : Introduction to Java Virtual Machine
Conrad Benham Java Opcode and Runtime Data Analysis By: Conrad Benham Supervisor: Professor Arthur Sale.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Static Program Analysis of Embedded Software Ramakrishnan Venkitaraman Graduate Student, Computer Science Advisor: Dr. Gopal Gupta
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
CISC Machine Learning for Solving Systems Problems Presented by: Suman Chander B Dept of Computer & Information Sciences University of Delaware Automatic.
Generating Software Documentation in Use Case Maps from Filtered Execution Traces Edna Braun, Daniel Amyot, Timothy Lethbridge University of Ottawa, Canada.
Virtual Application Profiler (VAPP) Problem – Increasing hardware complexity – Programmers need to understand interactions between architecture and their.
Heap liveness and its usage in automatic memory management Ran Shaham Elliot Kolodner Mooly Sagiv ISMM’02 Unpublished TVLA.
CSE 598c – Virtual Machines Survey Proposal: Improving Performance for the JVM Sandra Rueda.
Programming Languages and Paradigms Activation Records in Java.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
7. Graph Traversal Describe and compare depth-first and breadth-first graph searching, and look at the creation of spanning trees Contest Algorithms: 7.
Duke CPS Java: make it run, make it right, make it fast (see Byte, May 1998, for more details) l “Java isn’t fast enough for ‘real’ applications”
Source Level Debugging of Parallel Programs Roland Wismüller LRR-TUM, TU München Germany.
Static Timing Analysis
7 Finding Bridge in a Graph. What is a bridge ? A C D B F G E.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
An Efficient, Incremental, Automatic Garbage Collector P. Deutsch and D. Bobrow Ivan JibajaCS 395T.
LIOProf: Exposing Lustre File System Behavior for I/O Middleware
Profile, HAT, Wireless Toolkit’s Profile Sookmyung Women’s Univ. PSLAB Choi yoonjeong.
RealTimeSystems Lab Jong-Koo, Lim
Function Recursion to understand recursion you must understand recursion.
©2004 Joel Jones 1 CS 403: Programming Languages Lecture 3 Fall 2004 Department of Computer Science University of Alabama Joel Jones.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Design issues for Object-Oriented Languages
Compositional Pointer and Escape Analysis for Java Programs
Concepts of programming languages
Spare Register Aware Prefetching for Graph Algorithms on GPUs
Adaptive Code Unloading for Resource-Constrained JVMs
Pointer analysis.
자바 언어를 위한 정적 분석 (Static Analyses for Java) ‘99 한국정보과학회 가을학술발표회 튜토리얼
Interpreting Java Program Runtimes
Parameters, Overloading Methods, and Random Garbage
CSc 453 Interpreters & Interpretation
Presentation transcript:

Dynamic Analysis and Visualizing of Data Structures in Java Programs Presented by Sokhom Pheng (Supervisor: Clark Verbrugge) McGill University February 9 th 2005

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 2 Outline Motivation Brief overview of *J Requirements for data structure (DS) analysis Some algorithms for analysis Issues Future works

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 3 Motivation Visual understanding of data structure in java programs Help understand code without looking at source code Dynamic analysis

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 4 Brief Overview of *J Developed by Bruno Dufour in the sable lab Java Application *J Analyzer Data Structure Analyzer *J Agent (JVMPI) trace file

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 5 Why isn’t *J enough for DS Analysis? JVMPI doesn’t provide all info  Missing references of objects  Missing info on actual values for primitive Important for accessing arrays  Does not track objects

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 6 Requirements for Data Structures Analysis Need to simulate the whole program execution  Keep track of the JVM stacks Follow JVM design (VM Spec)  Invocation stack for each thread  Stack frame for each method  Execution stack to contain operand objects  Keep track of actual values (even of primitives) for array indices

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 7 Represent Data Structures in Memory Object, method and class has unique ID and entity (originally implemented in *J)  ObjectEntity: ID, name, type, size, …  MethodEntity: signature, name, class entity, …  ClassEntity: name, number of methods/interfaces, … Recreate objects and their references to each other by executing bytecodes found in the trace  Eg. putfield obj1 obj2

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 8 Algorithm for DS Analysis Goal: identifying data structures Started with identifying “tree”, “dag” and “cycle” detected by DFS treedag cycle

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 9 Algorithm for DS Analysis (con’d) Other way to identify DS  Combinatorial topology Shape represented by set of equations  Reference Shape Graph (RSG) 1 Node represent memory location having similar reference patterns 1 A new Dependence Test Based on Shape Analysis for Pointer-Based Codes, Navarro, Corbera, Asenjo, Tineo, Plata, Zapata, LCPC 2004

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 10 RSG Example

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 11 Advantage over Static Analysis public class BinaryTree {... public static void main(String[] args) {... tree.left = tree.right; tree.right = new Node(...);... }... } class Node {... } Static Analysis tree dag

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 12 Advantage over Static Analysis (con’d) From JOlden benchmark: BiSort After 62 modifications

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 13 Advantage over Static Analysis (con’d) From JOlden benchmark: BiSort After 63 modifications

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 14 Data Gathering Issues Start up code  JVMPI doesn’t start with JVM Lack of array indices  Primitive values from I/O Native methods

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 15 Potential Solutions Look only at application code Ignore arrays for now

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 16 Analysis Problems Multiple entry points treedag cycle obj1obj2 obj3 obj5 obj4 obj6 Sol’n: Look at all entry points individually obj7 obj8

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 17 Analysis Problems (con’d) Garbage objects  Induce multiple entry points  Dead nodes not trivially distinguished from live ones obj1 obj2 obj3 obj4 Garbage Node

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 18 Sol’n for Garbage Problem Root set  Exclude garbage objects not yet deleted by garbage collector  Static fields, live variables and live methods parameters obj2 obj1 obj2 obj1

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 19 Example of Entry Points public class Foo { static bar = new Bar(); public static void main(String[] args) { Foo foo = new Foo(); foo.foo1(new Bar());... } public void foo1(Bar b) { Foo f = new Foo();... } } class Bar {... } Root set {bar} {bar, foo} {bar, foo, b, f} {bar}

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 20 DS Configuration Options Self loop  Why do they exist?  Effect: makes everything cyclic

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 21 DS Configuration Options (con’d) Doubly-connected DS  Effect: makes everything cyclic  Not every edge is doubly-connected

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 22 Gathering Other Useful Info Encode “age” of modification  How a DS evolves over time Amount of garbage being carried  “Drag” effect

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 23 Drag Effect From JOlden benchmark: Barnes-Hut After 58 modifications

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 24 Legend / Encoding ≤ 1000 byte codes ≤ 100 byte codes ≤ 10 byte codes ≤ byte codes ≤ byte codes ≤ byte codes > byte codes Age of node New node Cycle DAG Tree obj1 Garbage

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 25 Example From JOlden benchmark: Barnes-Hut After 13 modifications

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 26 Garbage Option Option to show garbage objects or not

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 27 Representing Entry Points Different shapes and colours for entry point depending on type of DS

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 28 Drawing Tool Dot / Graphviz  Generates snapshots

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 29 Drawing Issue Drawing of one graph has no relation to drawing of the next  Dot try to be optimal  Jumps all over the place

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 30 Drawing Issue Example

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 31 Possible Solutions Tom Sawyer Software (currently investigating)  Incremental drawing Hack into Dot’s source code Add “inter-frames” between snapshots

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 32 Small Complete Example

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 33 Future Works Deal with arrays and unknown info  Draw approximate graph Handle start up code / native methods Investigate other drawing tools Add other analyses  RSG from LCPC paper  Topological approach (set of equations) Calculate “drags” for garbage objects Analyze more and more complex programs

February 9th 2005 Dynamic Analysis and Visualizing of Data Structures in Java Programs 34 Thank You!