Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multitasking without Compromise: a Virtual Machine Evolution

Similar presentations


Presentation on theme: "Multitasking without Compromise: a Virtual Machine Evolution"— Presentation transcript:

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

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

3 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 Fall 2004

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

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

6 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 Fall 2004

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

8 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 Fall 2004

9 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 Fall 2004

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

11 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 Fall 2004

12 In MVM 12/02/2004 CS Fall 2004

13 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 Fall 2004

14 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 Fall 2004

15 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 Fall 2004

16 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 Fall 2004

17 Performance – Memory footprint
12/02/2004 CS Fall 2004

18 Performance – Time overheads
12/02/2004 CS Fall 2004

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

20 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 Fall 2004

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

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

23 Memory Accounting 12/02/2004 CS Fall 2004

24 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 Fall 2004

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

26 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 Fall 2004

27 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 Fall 2004

28 Questions? 12/02/2004 CS Fall 2004


Download ppt "Multitasking without Compromise: a Virtual Machine Evolution"

Similar presentations


Ads by Google