View
117
Download
1
Embed Size (px)
DESCRIPTION
Oplægget blev holdt ved InfinIT-arrangementet "Temadag: Java for real-time and embedded systems", der blev afholdt hhv. den 12. og 13. september 2013. Læs mere om arrangementet her: http://infinit.dk/dk/arrangementer/tidligere_arrangementer/temadag_java_for_real-time_and_embedded_systems.htm
Citation preview
Temadag om Java
JamaicaVMHard Realtime Response for Java Programs
Dr. Isabel Tonin CEO, aicas
September 2013
2JamaicaVM: Realt ime Response for Java Applications
Java Advantages
Deep Ecosystem
Large number of developers
Diverse middleware and libraries
Many development tools
Well defined language
Minimizes errors (strong typing w/ GC)
Security and memory model
Support for parallelism & distribution
Supports dynamic code loading (modules)
3JamaicaVM: Realt ime Response for Java Applications
Real-Time Specification for Java
Realtime Tasking
Realtime threads
Event handling
Priority inversion avoidance
Control Flow
Deadline Mon & Cntrl
Overrun Mon & Cntrl
ATC
Input/Output
Raw memory
POSIX events
Happenings
Memory Areas
Immortal
Scope
Physical
4JamaicaVM: Realt ime Response for Java Applications
Java Problemsunpredictable pauses & delays
Java nondeterminism
Java application size
Java performance
Java RTSJ Scoped Memory complexity
Lack of Java on Embedded Platforms
The JamaicaVM Solution
JamaicaVM SolutionMultithreaded, fully preemptable Garbage Collector (RTGC)
worst case execution time analysis (WCETA) possible with deterministic RTGC
Smart Linker reduces executable size by up to 90%
ahead-of-time (AOT) compiler delivers “native” compiled code performance
no need for ScopedMemory
support for most embedded OSes & CPUs including GENIVI
5JamaicaVM: Realt ime Response for Java Applications
Realtime Java Technology
Static compiler technology with profiling
Faster code
Better time vs. space trade off
Smart linking
Only include what is necessary
Deterministic garbage collection
GC does not interrupt other (realtime) tasks
No pauses in the application
6JamaicaVM: Realt ime Response for Java Applications
Determinist ic Garbage Collection
Saves development time
No need to release objects explicitly
Fewer memory errors
Improves safety
Reduces the danger of memory leaks
Prevents premature object deallocation
Does not interfere with realtime response
7JamaicaVM: Realt ime Response for Java Applications
Certifying a Garbage Collector
Not possible for all collector
Must be deterministic; no unbound steps
Must assume maximum memory use
Must consider allocation rate
Work Based Collector
No root scan and compaction (unbound)
Mark and sweep steps on fixed size blocks
Automatically tracks allocation rate
8JamaicaVM: Realt ime Response for Java Applications
Conventional Garbage Collection
GC can interrupt execution for long periods of time:
Problem
long, unpredictable pauses during execution
9JamaicaVM: Realt ime Response for Java Applications
RTSJ & Conventional Garbage Collection
No heap threads can interrupt garbage collector:
The application must be split into a realtime and a nonrealtime part.
10JamaicaVM: Realt ime Response for Java Applications
Realtime Garbage Collection
Paced garbage collectorRun GC at a high priority
Runs at given interval, for given amount of time
Programmer must provide both maximum memory use and maximum allocation rate
Slack garbage collectorRun GC at lower priority than realtime tasks
Runs when processor cycles are available
Programmer must provide both maximum memory use and maximum allocation rate
11JamaicaVM: Realt ime Response for Java Applications
Realtime Garbage Collection
Work based garbage collector
No GC thread
GC borrows application thread
Need only determine maximum memory use
No read barriers needed
Low latency
12JamaicaVM: Realt ime Response for Java Applications
Work-Based Garbage Collector
All Java Threads are realtime threads
GC work is performed at allocation time
GC work must be sufficient to recycle enough memory before free memory is exhausted
Execution time of all allocations must be bound
13JamaicaVM: Realt ime Response for Java Applications
JamaicaVM Builder Architecture
DefaultCode Generator
Machine Code Optimization
SSA Converter
Byte Code Reader
Java Byte Code
IntermediateCode
SSA Blocks
Machine Code
Object Code Writer
SSA IC Optimization
Machine Code Generator
Machine Code Generation Rules
SSA IC Optimization Rules
Object Code (ELF/PECOFF)
Machine Code Optimization Rules
Processor Definition
C Code Generator
C Compilation
C Code
14JamaicaVM: Realt ime Response for Java Applications
aicas Drives Standards Forward
Java Community Process
JSR 282: update Real-Time Specification for Java
JSR 302: Safety Critical Java
JSR 50: Distributed Realtime Java
SC-205/WG-71 Plenary
Update software standards for civil aviation:DO-178, -248, -278, -330, -331, -332, and -333
Active in SG-5: Object Oriented Technology
Java Modeling Language (JML)
15JamaicaVM: Realt ime Response for Java Applications
Major RTSJ Improvements
Raw Memory
Typed device access
Factory based
ActiveEvents
Unify API for Timer, Happening, & Signal
Happening object
ISR Support
Stateful Events & Handlers
Object & long
POSIX Realtime Signal
CPU Affinity
New Scope types
PinnableMemory
StackedMemory
16JamaicaVM: Realt ime Response for Java Applications
Applications
17JamaicaVM: Realt ime Response for Java Applications
JamaicaVM vs. Oracle’s JDK
JamaicaVM
Realtime GCno GC pauses
Supports realtime priorities w/ OS map
RTSJ APIsRealtimeThread,
AsyncEvent, etc.
Static compilation
Flexible license
Oracle’s JDK
Conventional GCGC causes pauses
Priorities ill defined w/o mapping to OS
No RTSJ support, just standard classes
JIT Only
One for all license(not free)
18JamaicaVM: Realt ime Response for Java Applications
Conclusion
State-of-the-art Java technology
Realtime garbage collection
Compilation and linking technology
Complete RTSJ implementation
multicore support
Market proven products
Dedicated to standards
Tools to ensure your system works correctly