© 2007 IBM Corporation IBM Software Group September 26, 2007 Tactics for Minimal Interference from Class Loading in Real-Time Java™ The 5th International.

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

An Overview Of Virtual Machine Architectures Ross Rosemark.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
IBM JIT Compilation Technology AOT Compilation in a Dynamic Environment for Startup Time Improvement Kenneth Ma Marius Pirvu Oct. 30, 2008.
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Compilation 2007 Code Generation Michael I. Schwartzbach BRICS, University of Aarhus.
Overview Motivations Basic static and dynamic optimization methods ADAPT Dynamo.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Load-time structural reflection in Java – Shigeru Chiba, 2000 May 27, 2004 Shimin.
Compilation Technology Oct. 16, 2006 © 2006 IBM Corporation Software Group Reducing Startup Costs of Java Applications with Shared Relocatable Code Derek.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Java Card Technology Ch06: Exception and Exception Handling Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
IBM Software Group © 2005 IBM Corporation Compilation Technology Toward Deterministic Java Performance Mark Stoodley, Mike Fulton Toronto Lab, IBM Canada.
Aarhus University, 2005Esmertec AG1 Implementing Object-Oriented Virtual Machines Lars Bak & Kasper Lund Esmertec AG
Introduction to Java Programming
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
SEC(R) 2008 Intel® Concurrent Collections for C++ - a model for parallel programming Nikolay Kurtov Software and Services.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSC 8505 Compiler Construction IR Example: Java Bytecode (looking inside class files)
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
WCET Analysis for a Java Processor Martin Schoeberl TU Vienna, Austria Rasmus Pedersen CBS, Denmark.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Java Bytecode What is a.class file anyway? Dan Fleck George Mason University Fall 2007.
J-OCM is a system for monitoring distributed Java applications conforming to OMIS specification with J-OMIS extensions. It is used to: gather information.
Compilation Technology © 2007 IBM Corporation CGO Performance Overheads In Real-Time Java Programs Mark Stoodley and Mike Fulton Compilation.
The Terminator to Android Hardening Services
1 Java Bytecode Optimization Optimizing Java Bytecode for Embedded Systems Stefan Hepp.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
1 Advance Computer Architecture CSE 8383 Ranya Alawadhi.
Java Virtual Machine Case Study on the Design of JikesRVM.
Buffered dynamic run-time profiling of arbitrary data for Virtual Machines which employ interpreter and Just-In-Time (JIT) compiler Compiler workshop ’08.
IBM Software Group, Compilation Technology © 2007 IBM Corporation Some Challenges Facing Effective Native Code Compilation in a Modern Just-In-Time Compiler.
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
Java Security Model For Mobile Code Abdo Achkar. Mobile Code A mobile object is a “self contained piece” of executable code. Definition:  Code that can.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I John Cavazos University.
Chapter 10: Introduction to Inheritance. Objectives Learn about the concept of inheritance Extend classes Override superclass methods Call constructors.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
Introduction Why are virtual machines interesting?
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
DEV394 Windows Forms Performance Tips And Tricks Mike Henderlight Development Manager.NET Client Team Microsoft Corporation
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
UNDER THE HOOD: THE JAVA VIRTUAL MACHINE II CS2110 Fall 200 Lecture 25 1.
Reflections CSC207 – Software Design. Background Turing's great insight: programs are just another kind of data. Source code is text that is interpreted.
Introduction to Programming 1 1 2Introduction to Java.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Performance Tuning Chia-heng Tu PAS Lab Summer Workshop 2009 June 30,
Preface IIntroduction Course Objectives I-2 Oracle Complete Solution I-3 Course Agenda I-4 Tables Used in This Course I-5 The Order Entry Schema I-6 The.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Applications Active Web Documents Active Web Documents.
Java Interview Questions
CS216: Program and Data Representation
CMPE419 Mobile Application Development
2.1. Compilers and Interpreters
Debugging Techniques.
Mobile Handset Virtual Machine
Accelerate application delivery with a Cloud-native mindset
Java Byte Codes (0xCAFEBABE) cs205: engineering software
Java History, Editions, Version Features
Java Remote Method Invocation
CMPE419 Mobile Application Development
Presentation transcript:

© 2007 IBM Corporation IBM Software Group September 26, 2007 Tactics for Minimal Interference from Class Loading in Real-Time Java™ The 5th International Workshop on Java Technologies for Real-time and Embedded Systems - JTRES 2007 Institute of Computer Engineering Vienna University of Technology Vienna, Austria Sean Foley, IBM Software Group, Ottawa, Canada

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 2 Agenda  Motivations for altering class loading behaviour in Real-Time Java  Tactics, experiences, results : –Reducing the size and number of classes to load –Elimination of premature loading –Redistribution of loading –Elimination of repeated loading –Alternative class formats  Requirements for Implementation of Techniques

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 3 Loading Takes Time

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 4 Motivations and Rationale  Class Loading Impacts Real-Time Requirements  Simplest approach: load everything at startup –Can be optimized –Not necessarily easy (code paths, development) –Can be excessive (memory/time), particularly for large apps. –Not all classes needed for each invocation  Startup time possibly subject to timing constraints  Alternative approaches beneficial for optimal usage of resources

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 5 Instantiated Type Analysis (ITA) determines what methods and classes can be removed ITA instantiates objects for more accurate analysis to determine reachable items Basic control flow analysis follows all references with the code

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 6 Advanced Control Flow Analysis ITA control flow analysis involves exception object throwing and virtual method invocations

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 7 Elimination of loading Induced by Verification  Runtime bytecode verifier loads classes to verify inheritance.  Can be avoided by inserting checkcast bytecodes. OperationVerifier requirement Non-static field access or method invocationReceiver must be subtype of declaring class of field/method Field storeStored object must be subtype of field type Method invocationArguments must be subtypes of parameters Return instructionReturned object must be subtype of return type Throw instruction or exception handlerThrown or caught object must be Throwable Example: static BaseClass aMethod(SubClass subClass) { if(subClass == null) throw new NullPointerException(); return subClass; } Bytecodes: aload_0 aconst_null ifnull new invokespecial checkcast athrow aload_0 checkcast areturn (Throwable) (BaseClass)

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 8 Cold Method Refactoring: Distributed Loading Refactoring steps: 1.Identify a method to be migrated 2.Create a counterpart static method in a shell class 3.Migrate the body of the original method 4.Replace the method body with an invocation of the counterpart Result:  Bytecode verification of the original method is delayed  Loading time of original class is split The most expensive stage of loading is bytecode verification.

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 9 Persistent Class Sharing  Class representations shared amongst VMs: concurrently, sequentially  Cache can exist in shared memory or on file system  Share: classes, strings, compiled code  Not everything shareable: constraints from verifier, advanced optimizations  Multiple shared caches more flexible IBM LS20 Blade Server / real-time linux / IBM Java5 VM

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 10 Alternative File Formats  Load precompiled native code (AOT or ahead-of-time)  With IBM’s WebSphere Real-Time, the steps are:  Other class file formats have been designed  The class file format specification itself allows the delivery of additional data Jar files Compile AOT Bound jar files Real-time execution Other jar files Compile Java Source files Run

IBM Software Group Tactics for Minimal Interference from Class Loading in Real-Time Java | JTRES 2007 © 2007 IBM Corporation 11 Summary  Class Loading can Interference with Real-Time Constraints  Tactics to alter loading: –Reducing the size and number of classes to load –Elimination of premature loading –Temporal redistribution of loading –Elimination of repeated loading –Alternative methods of loading  Implementation require analysis, tuning, building, some insight into the app  Tools and resources are available for implementation