Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1,...

28
Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001

Transcript of Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1,...

Page 1: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Challenges and Solutions for Embedded Java

Michael Wortley

Computer Integrated Surgery

March 1, 2001

Page 2: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

TINI CORBA ORB Project

• Goal: to port Java based CORBA ORB to TINI board

• Problem: Converting from JDK1.3 to TINI’s embedded Java

Page 3: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Goals of this Presentation

• Provide background of Java’s benefits

• Show how embedded environment presents challenges to the Java platform

• Highlight available solutions

Page 4: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Main Sources

• “Challenges to Embedded Java”– Charlie McDowell, UC Santa Cruz– 1998 PowerPoint presentation

• “Technical Overview of Embedded Java”– 4/2000, From Sun Website

Page 5: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Other Sources

• “Java Schism?”– Rick Cook, Java Report 6/99

• “About Java Technology”– Sun Website

• TINI software information from www.iButton.com

Page 6: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Goals of this Presentation

• Provide background of Java’s benefits

• Show how embedded environment presents challenges to the Java platform

• Highlight available solutions

Page 7: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

“Write Once, Run Anywhere.”

Page 8: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.
Page 9: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Why do Programmers like Java?

• Compiled and Interpreted

• Easy Upgrades through API

• JVM = Portability

Page 10: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Goals of this Presentation

• Provide background of Java’s benefits

• Show how embedded environment presents challenges to the Java platform

• Highlight available solutions

Page 11: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

“Challenges to Embedded Java”

PowerPoint Presentation by Charlie McDowell, 1998.

Page 12: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Key Points

• Java is superior to C++ in ease of development, maintenance, and portability

• Java API and JVM put too much stress on embedded processors

• Java tends to have slower execution time

Page 13: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Key Points

• Automatic garbage collection causes problems

• Java lacks real-time support

Page 14: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Java Memory Requirements

• Storage of Java API– up to 9 MB for JDK1.1

• JVM– between 300 and 800 KB

• Garbage Collection Overhead– copy collectors -> requires 2x max. heap

usage– conservative collectors -> memory leaks

Page 15: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Java Execution Time

• Interpreted code runs more slowly than compiled code

• Resolving references prior to execution reduces run time

• Using final and static methods can reduce dynamic dispatch of functions

• Garbage Collection eats memory

Page 16: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Garbage Collection

• Part of what makes Java simple

• Problematic for real-time applications

Page 17: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Java and Real-Time Applications

• Java lacks:– reliable methods of estimating worst case– ability to measure CPU time, memory use– enforcement of time and space budgets– real-time garbage collection

• IMPROVEMENTS NEEDED!

Page 18: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Suggested Optimizations for Embedded Java

• Reduce API to free memory

• Use final and static functions to decrease execution time

• Eliminate automatic garbage collection

• Find ways to improve real-time performance

Page 19: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Non-Sun Embedded Java

• PERC by NewMonics– real-time garbage collection

• VxWorks– only 628 KB

• JN from UCSC– JIT from Kaffe– reduced API

Page 20: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Goals of this Presentation

• Provide background of Java’s benefits

• Show how embedded environment presents challenges to the Java platform

• Highlight available solutions

Page 21: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

“Technical Overview of Embedded Java Technology”

Sun Microsystems

http://java.sun.com/products/embeddedjava/overview.html

Page 22: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Improvements in Sun’s Embedded Java

• Configurable API

• Configurable JVM

• JavaFilter tool

• JavaCodeCompact

• JavaDataCompact

Page 23: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

New Programming Tools

• JavaFilter– input

• source code • Java API

– output• list of necessary API

classes and methods

Page 24: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

New Programming Tools

• JavaCodeCompact– input

• Source Code • Java API• list of necessary API

classes and methods

– output• data structures in C

code

Page 25: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

New Programming Tools

• JavaDataCompact– input

• associated data files • Java API

– output• data structures in C

code

Page 26: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

How this Relates to TINI

• TINI’s embedded Java is Sun compatible.

• Limitted API• Development Tools

– TINI API– TINIConvertor

Page 27: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

Conclusions about Embedded Java

• Increasing complexity of embedded devices will force makers to use high level language

• Java’s fast development time and portability are ideal for large manufacturers

• Competition needed to drive advancements

Page 28: Challenges and Solutions for Embedded Java Michael Wortley Computer Integrated Surgery March 1, 2001.

So long, and thanks for all the fish.