Presentation is loading. Please wait.

Presentation is loading. Please wait.

(Not too) Real-Time JVM (Progress Report)

Similar presentations


Presentation on theme: "(Not too) Real-Time JVM (Progress Report)"— Presentation transcript:

1 (Not too) Real-Time JVM (Progress Report)
Dec. 28, 2001 Jong-Koo,Lim RealTimeSystems Lab

2 Contents Goal Related Works Java Virtual Machine Real-Time Java
System Architecture Inside Java Virtual Machine Problems with typical JVM Real-Time Java Seven Enhanced Areas

3 Goal Design and Implementation of
Real-Time Extensions in Java Virtual Machine

4 Related Works Java Virtual Machine Real-Time Java
Current JVM : Kaffe, Hotspot, CVM, KVM Platform : Real-Time Linux Real-Time Java Java is not appropriate for real-time software It is possible to support real-time software if java has any special implementation Seven Enhanced Areas

5 Java Virtual Machine System Architecture Inside Java Virtual Machine
Problems with typical JVMs

6 System Architecture Class Libraries Java Threads Native Threads
Java Virtual Machine Native Methods (Real-Time) Operating System Processor and Other Hardware

7 Inside a Java Virtual Machine
Find and load referenced class in the CLASSPATH Java Application ClassFile { u4 magic; u2 minor_version; u2 major_version; u2 constant_pool_count cp_info constant_pool[ ]; u2 access_flags; u2 this_class; u2 super_class; u2 interfaces_count; u2 fields_count; u2 methods_count; u2 attributes_count; } Class Libraries Class Loader Execution Engine performs the final translation - Bytecode to native opcode Difference engine types - Bytecode interpreter - Just-in-time compiler - Hybrid Bytecode Verifier Native Methods Execution Engine Run-time Data Area Garbage Collector Method Area heap Java Stacks PC Registers Native Method Stacks Run-time Data Areas Simplest Garbage Collector - Incremental Garbage Collector (Real-Time) Operating System 7 RealTimeSystems Lab

8 Garbage Collection Two basic sequence Two basic approach
Detect garbage objects Reclaim the heap space Two basic approach Reference-counting garbage collector a reference count is maintained for each object Tracing garbage collector trace out the graph of object references, starting with the root nodes. class A { ….. ; } A a1 = new A(); A a2 = new A(); A a3 = a1; // a1’s rc = 2 A a4 = a1; // a1’s rc = 3 a2 = null; /* a2’s rc =0, so, a2 is garbage */

9 Inside a Java Class Files
- Class File Header CAFEBABE magic = ca fe ba be minor version = 3 d major version = 45 Constant Pool constants 00000a 0A006600AB 1. Methodref class #102 , name-and-type #171 00000f AC 2. Fieldref class #101, name-and-type #172 (the following is omitted) Constant Pool Tag Class index Constant Pool Entry

10 Oolong (Assembly Language for JVM)
DumpClass : => Display and Analyze ‘class file’ in a bytecode unit Gnoloo : *.class => *.j Oolong : *.j => *.class

11 Problems with typical JVM
Too Big A full-featured JVM is huge(~500k of ROM) In addition there are class libraries, heap, etc Too Slow Bytecode interpretation Run-time checks Too Unpredictable Default garbage collectors are not very good in RTS

12 Real-Time Java (next work)
Seven Enhanced Areas Thread Scheduling and Dispatching Memory Management (Garbage Collector) Synchronization and Resource Sharing Asynchronous Event Handling Asynchronous Transfer of Control Asynchronous Thread Termination Physical Memory Access


Download ppt "(Not too) Real-Time JVM (Progress Report)"

Similar presentations


Ads by Google