Profiling Field Initialisation in Java Stephen Nelson, David J. Pearce & James Noble Victoria University of Wellington New Zealand.

Slides:



Advertisements
Similar presentations
Sml2java a source to source translator Justin Koser, Haakon Larsen, Jeffrey Vaughan PLI 2003 DP-COOL.
Advertisements

1 Processes and Threads Creation and Termination States Usage Implementations.
Computer Science 320 Clumping in Parallel Java. Sequential vs Parallel Program Initial setup Execute the computation Clean up Initial setup Create a parallel.
Overview Motivation Scala on LLVM Challenges Interesting Subsets.
 Specifies a set of methods (i.e., method headings) that any class that implements that interface must have.  An interface is a type (but is not a class).
Software & Services Group PinPlay: A Framework for Deterministic Replay and Reproducible Analysis of Parallel Programs Harish Patil, Cristiano Pereira,
Mutability SWE 332 Fall 2011 Paul Ammann. SWE 3322 Data Abstraction Operation Categories Creators Create objects of a data abstraction Producers Create.
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Study of Hurricane and Tornado Operating Systems By Shubhanan Bakre.
CS 211 Inheritance AAA.
Relationship Aspects David J. Pearce and James Noble Victoria University of Wellington, New Zealand.
Parallelized variational EM for Latent Dirichlet Allocation: An experimental evaluation of speed and scalability Ramesh Nallapati, William Cohen and John.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 Chapter 12 More OOP, Interfaces, and Inner Classes.
1 Chapter 6 Inheritance, Interfaces, and Abstract Classes.
Automatic Extraction of Object-Oriented Component Interfaces John Whaley Michael C. Martin Monica S. Lam Computer Systems Laboratory Stanford University.
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
OOP Languages: Java vs C++
Qualitative Studies: Case Studies. Introduction l In this presentation we will examine the use of case studies in testing research hypotheses: l Validity;
Programming Languages and Paradigms Object-Oriented Programming.
Interpreting the data: Parallel analysis with Sawzall LIN Wenbin 25 Mar 2014.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
University of Maryland Compiler-Assisted Binary Parsing Tugrul Ince PD Week – 27 March 2012.
Protection and the Kernel: Mode, Space, and Context.
1 Process States (1) Possible process states –running –blocked –ready Transitions between states shown.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
CIS 199 Test 01 Review. Computer Hardware  Central Processing Unit (CPU)  Brains  Operations performed here  Main Memory (RAM)  Scratchpad  Work.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Understanding Parallelism-Inhibiting Dependences in Sequential Java Programs Atanas (Nasko) Rountev Kevin Van Valkenburgh Dacong Yan P. Sadayappan Ohio.
Performance Issues in Parallelizing Data-Intensive applications on a Multi-core Cluster Vignesh Ravi and Gagan Agrawal
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS Design.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION MIDTERM REVIEW Autumn 2011.
MapReduce How to painlessly process terabytes of data.
A User-Lever Concurrency Manager Hongsheng Lu & Kai Xiao.
1 Evaluating the Impact of Thread Escape Analysis on Memory Consistency Optimizations Chi-Leung Wong, Zehra Sura, Xing Fang, Kyungwoo Lee, Samuel P. Midkiff,
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
Object Based Programming Chapter 8. 2 In This Chapter We will learn about classes Garbage Collection Data Abstraction and encapsulation.
Investigating the Effects of Using Different Nursery Sizing Policies on Performance Tony Guan, Witty Srisa-an, and Neo Jia Department of Computer Science.
University of Maryland Using Dyninst to Measure Floating-point Error Mike Lam, Jeff Hollingsworth and Pete Stewart.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
DynamicMR: A Dynamic Slot Allocation Optimization Framework for MapReduce Clusters Nanyang Technological University Shanjiang Tang, Bu-Sung Lee, Bingsheng.
Puzzle 1  what does the following program print? public class Puzzle01 { public static void main(String[] args) { System.out.print("C" + "S" + "E"); System.out.println('1'
Performance and Energy Efficiency Evaluation of Big Data Systems Presented by Yingjie Shi Institute of Computing Technology, CAS
Lecture 8: Lottery Scheduling 1. Class Plan Lottery scheduling: – Motivation – Solution proposed Group work and answers on: – Implementation issues: challenges?
CMSC 330: Organization of Programming Languages Threads.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
ApproxHadoop Bringing Approximations to MapReduce Frameworks
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
YG - CS Concept of Encapsulation What is encapsulation? - data and functions/methods are packaged together in the class normally.
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
Programming Multi-Core Processors based Embedded Systems A Hands-On Experience on Cavium Octeon based Platforms Lab Exercises: Lab 1 (Performance measurement)
Mutability SWE 332 Fall 2015 Paul Ammann. SWE 3322 Data Abstraction Operation Categories Creators Create objects of a data abstraction Producers Create.
C++ General Characteristics: - Mixed typing system - Constructors and destructors - Elaborate access controls to class entities.
CopperDroid Logan Horton. Android - Background Android is complicated to analyse due to having 2 places to check for code execution Normally, code is.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Resilient Distributed Datasets A Fault-Tolerant Abstraction for In-Memory Cluster Computing Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave,
Java Interview Questions
Testing Tutorial 7.
Effective Data-Race Detection for the Kernel
Adaptive Code Umamaheswaran Senior Software Engineer
Object Based Programming
Chapter 4: Threads.
Interfaces.
Android Topics UI Thread and Limited processing resources
Prof. Leonardo Mostarda University of Camerino
Basic Mutability Paul Ammann.
Threads and concurrency / Safety
Presentation transcript:

Profiling Field Initialisation in Java Stephen Nelson, David J. Pearce & James Noble Victoria University of Wellington New Zealand

Motivation “Favour Immutability”, #13, Effective Java: –"Classes should be immutable unless there's a very good reason to make them mutable....If a class cannot be made immutable, limit its mutability as much as possible.” –“Immutable classes are easier to design, implement, and use than mutable classes” -- Josh Bloch

Motivation “Favour Immutability”, #13, Effective Java: –"Classes should be immutable unless there's a very good reason to make them mutable....If a class cannot be made immutable, limit its mutability as much as possible.” –“Immutable classes are easier to design, implement, and use than mutable classes” -- Josh Bloch Q) How well does Java support this?

Field Initialisation Java provides final fields to prohibit modification and show intent Unfortunately, in this example, cannot declare parent field final abstract class Parent { private final Child child; public Parent(Child c) { this.child = c; } } abstract class Child { private Parent parent; public void set(Parent p) { parent = p; } }

Stationary Fields A field is stationary if, for all objects, every write occurs before first read Unkel & Lam (POPL’08) statically inferred stationary fields –Across corpus of 26 Java Applications, found between 40-60% of fields were stationary WRWR W RWR

More on Stationary Fields Final fields are subset of stationary fields: Distinguish Declared Final and Undeclared Final WRWR CE WRWR WRRR

Rprof – Overview Our Runtime Profiling Tool: –Whole-program, including standard libraries –No sampling, record and analyse every event –Tracks constructor entry/exit and field read/write

Rprof – Map/Reduce Problem: how to handle billions of events? Answer: throw more hardware at it! –Event processing done using Map/Reduce –Events processed in parallel to give more manageable results –Worker threads spread over multiple machines Consequence: less flexibility –Must customise map/reduce procedure for each distinct analysis

Rprof – Map/Reduce Example 1. W #1.f 2. W #2.g 3. W #1.f 4. R #2.g 5. W #2.g 6. R #1.f 1. W #1.f 2. W #2.g 3. W #1.f 4. R #2.g 5. W #2.g 6. R #1.f 1. W #1.f 2. W #2.g 3. W #1.f 4. R #2.g 5. W #2.g 6. R #1.f Reduce LW: 3 FR: 6 LW: 5 FR: 4

Experimental Setup Methodology: –Profile single run of benchmark with default input –OpenJDK ea-b37 was the experimental platform (*) –Opteron 254 (2.8GHz) dual CPU with 4GB was experimental machine Dacapo Benchmark Suite –14 Applications – classes –Non-trivial memory loads –Workloads provided –No User Interaction –Reproduceable Results

Results – Overall Key Observation: 70% -- 80% of fields are stationary

Results – Primitives vs References

Threats to Validity Benchmark Inputs –Cannot generalise program behaviour from a single run! –Better to use a set of inputs – but how to generate them? Benchmark Scope –Unclear whether DeCapo representative of general population Conclusion: –Our results provide upper bound on number of stationary fields –Unkel & Lam provide lower bound on number of stationary fields

Conclusion Unkel & Lam –Static inference of stationary fields –Found 40-60% of fields were stationary –Static analysis conservative -> lower bound Our results –Complement that of Unkel & Lam –Use runtime profiling instead of static inference –Found 70-80% of fields are stationary –Runtime profiling is unsound -> upper bound