Multitasking without Compromise: a Virtual Machine Evolution

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
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.
Names and Bindings.
Linking & Loading CS-502 Operating Systems
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
The Java Language. Topics of this Course  Introduction to Java  The Java Language  Object Oriented Programming in Java  Exceptions Handling  Threads.
490dp Synchronous vs. Asynchronous Invocation Robert Grimm.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Multitasking JVMs Isolates and KaffeOS Presentation by James Rose.
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.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
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.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
O VERVIEW OF THE IBM J AVA J UST - IN -T IME C OMPILER Presenters: Zhenhua Liu, Sanjeev Singh 1.
1 Introduction to JVM Based on material produced by Bill Venners.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
Impact of Java Compressed Heap on Mobile/Wireless Communication Mayumi KATO and Chia-Tien Dan Lo (itcc’05) Department of Computer Science, University of.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
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.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Programming Languages and Paradigms Activation Records in Java.
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Java & The Android Stack: A Security Analysis Pragati Ogal Rai Mobile Technology Evangelist PayPal, eBay Java.
RealTimeSystems Lab Jong-Koo, Lim
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Object Oriented Programming in
Java™ 2 Platform Getting Started.
SLC/VER1.0/OS CONCEPTS/OCT'99
Jonathan Walpole Computer Science Portland State University
Topic: Java Garbage Collection
Current Generation Hypervisor Type 1 Type 2.
Distributed Shared Memory
The Mach System Sri Ramkrishna.
COMBINED PAGING AND SEGMENTATION
Compositional Pointer and Escape Analysis for Java Programs
Linking & Loading.
Memory Management © 2004, D. J. Foreman.
Chapter 4: Threads 羅習五.
CS-3013 Operating Systems C-term 2008
Introduction Enosis Learning.
Introduction Enosis Learning.
Adaptive Code Unloading for Resource-Constrained JVMs
Introduction CSC 111.
Multithreaded Programming
Linking & Loading CS-502 Operating Systems
Outline Chapter 2 (cont) OS Design OS structure
Introduction Previous work Test Suite Minimization
Operating System Introduction.
Java Programming Introduction
System calls….. C-program->POSIX call
Virtual Memory: Working Sets
Linking & Loading CS-502 Operating Systems
CSE 542: Operating Systems
Presentation transcript:

Multitasking without Compromise: a Virtual Machine Evolution Grzegorz Czajkowski Laurent Daynes Sun Microsystems Laboratories Presented by: Subodh J. Lele 12/02/2004 CS 5204 - Fall 2004

Introduction - Java VM Used by applications, applets Appears as an OS Ad hoc layer JVM Base OS 12/02/2004 CS 5204 - Fall 2004

Problems Interference between two apps Examples All are undesired! Monopoly over heap space Leaky object references Sharing event and finalization queues Internalized strings All are undesired! 12/02/2004 CS 5204 - Fall 2004

Internalized Strings Avoids duplicates String a = “abc”; String b = a.intern(); Need to use synchronized (a) { … } 12/02/2004 CS 5204 - Fall 2004

Solutions Separate VMs Multitasking VM (MVM) Each VM as a OS process Multitasking version of JVM OS-style multitasking 12/02/2004 CS 5204 - Fall 2004

Separate VMs Advantages Disadvantages Fault isolation Higher Programmer productivity Disadvantages Inefficient resource utilization Downgraded performance Poor scalability Poor application startup time 12/02/2004 CS 5204 - Fall 2004

MVM Applications are protected from each other Multitasking features TASKS Multitasking features Safe Secure Scalable NO COMPROMISE approach 12/02/2004 CS 5204 - Fall 2004

MVM Goals Just like those of an OS No interference JVM illusion Perform and scale well Just like those of an OS 12/02/2004 CS 5204 - Fall 2004

Design decisions Examine each component Changes to JVM Shareable Non-Shareable… replicate Changes to JVM No bytecode editing Separate task data sets End task at any time 12/02/2004 CS 5204 - Fall 2004

MVM Design Lightweight Isolation Memory Management User-Level Native Code 12/02/2004 CS 5204 - Fall 2004

Lightweight Isolation Share as much as possible Replicate everything else Issues Class Initialization Accessing appropriate copy Efficient retrieval Making it scalable 12/02/2004 CS 5204 - Fall 2004

In MVM 12/02/2004 CS 5204 - Fall 2004

Class Initialization Different from object initialization Done by <clinit> class ClassInitialization { static int first = 3;    static int second = 1 + first;    public static void main (String [] args)  { X.y++;   } } class X { static { System.out.println("Hello World"); } static int y; 0   iconst_3 1   putstatic ClassInitialization/first I 4   iconst_1 5   getstatic ClassInitialization/first I 8   iadd 9   putstatic ClassInitialization/secondI 12/02/2004 CS 5204 - Fall 2004

Loading and Linking Loading Linking Create main memory representation Create TCM Add static variables Mark “loaded” Linking Verify class Check loader constraints Build constant pool cache 12/02/2004 CS 5204 - Fall 2004

Dynamic code rewriting Class initialization barrier Check for entry in TCM table Once per task Necessitates two entries Link resolution barrier Unchanged from JVM 12/02/2004 CS 5204 - Fall 2004

Other issues Quickened bytecodes Sharing Complied Code Re-introduce barriers Affects only four methods Sharing Complied Code Native code for method Patching stubs Class initialization barriers 12/02/2004 CS 5204 - Fall 2004

Performance – Memory footprint 12/02/2004 CS 5204 - Fall 2004

Performance – Time overheads 12/02/2004 CS 5204 - Fall 2004

Memory Management Heap Memory Mechanisms Surplus memory management Memory accountability Per-task Garbage Collections 12/02/2004 CS 5204 - Fall 2004

In HSVM New Generation Old Generation Eden Aging For new objects Aging From-space Objects garbage collected (GC) To-space Old Generation Collection triggered when filled up 12/02/2004 CS 5204 - Fall 2004

In MVM Old generation shared New generation common More activities occur here Eliminates heap-related interference 12/02/2004 CS 5204 - Fall 2004

Surplus Memory Management Postpone or avoid GC Given to new generation Handled by New Space Manager (NSM) 12/02/2004 CS 5204 - Fall 2004

Memory Accounting 12/02/2004 CS 5204 - Fall 2004

Performance – Memory Management Overheads Replicated new generation Memory accounting Extending eden and book-keeping Conclusion Execution time benefits from larger eden 12/02/2004 CS 5204 - Fall 2004

Handling Native Code Isolation layer Native library replicated Redefines functions to include arguments 12/02/2004 CS 5204 - Fall 2004

My evaluation - pros MVM is a complete system Appears just like a JVM for apps Provides excellent multitasking features Safe Secure Scalable 12/02/2004 CS 5204 - Fall 2004

My evaluation - cons One app can crash the VM When interaction is required, costly local RPC needed GC forced by one task can interfere with another task’s performance It does compromise! 12/02/2004 CS 5204 - Fall 2004

Questions? 12/02/2004 CS 5204 - Fall 2004