<Insert Picture Here>
Java SE and Embedded SE The road forward, 2011 edition
Greg Bollella Chief Architect, Embedded Java
2
A Moment of Silence
• To remember those who perished in the earthquake and tsunami and to honor those helping with the reactor and all other restoration activities
3 3
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
4
A Word on Content
• There is much more content in this presentation than we can talk about in an hour. Today I will highlight important points. Please obtain copies to reference after today. • Feel free to contact me with any questions at any
time.
5
Agenda
• Java SE – Past – Present – Future
• Embedded Java (SE and OJEC) – Background – Tips – Trends, Futures – Resources – Demo
• Q&A
6
Apples and Pears
JDK
javac
java
JRE
jdbc
I/O
JVM G1 -Xmx=4g
7
Past
8
Language
1.1
• 1997 • JDBC
1.3
• 2000 • Hotspot
5.0
• 2004 • Generics
7
• ?
1.0
• 1996
1.2
• 1998 • Collections
1.4
• 2002 • JCP
6
• 2006 • JVMTI
9
Working In Java
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
10
Work in Java
http://www.indeed.com/jobtrends?q=java%2Cc%23%2Cpython%2Cruby%2Cperl%2Cscala%2C+erlang%2C+groovy&l=
11
2000
2009
2006
2002
JRockit products
• Complete insight into application & JVM behavior
• Zero performance overhead in production environments
• No application modification or configuration required
JROCKIT MISSION CONTROL
• High-performance real-time solution for standard Java
• Industry leading Deterministic Garbage Collector
• Millisecond response times with “five nines” guarantee
• Improve application performance & latency with unique tooling
JROCKIT REAL TIME
• Fly-weight Java container for virtualized environments
• Improve datacenter efficiency - do more with less
• Simpler and more powerful VM management
JROCKIT VIRTUAL EDITION
• Server-side focus • World-class performance
• Powerful diagnostics
JROCKIT JVM
12
Java SWOT – Sun days
Strengths • Most used programming language • Garbage collection • Community driven • Adaptive runtime • Install base • Strong community • High performance
Weaknesses • No new releases • Steward out of cash • No good Smart phone story
Opportunities • Multi Core • JVM interop • Cloud
Threats • Next big thing • Walled garden platforms • Not attractive to new developers • Uncertain future
13
Present
14
What occupies our days?
• Dev – Java 7 – JDK 7 – Convergence
• “Misc” – Reconnecting with community – Java 8 – Java 9+
15
JDK 7 / Java 7
Plan B • Sep 8 2010
Java 7 JSR approved • Dec 7 2010
JDK 7 Feature Complete • Dec 16 2010
GA • Jul 28 2011
16
2 teams enter, one team leave…
• Hotspot
17
2010 Eclipse Community survey
69,8 + 21.7% vs 4.6%
18
2 teams enter, one team leave…
• Hotspot – Market share
19
2 teams enter, one team leave…
• Hotspot – Market share – Client and Server version – Quality
20
2 teams enter, one team leave…
• Hotspot – Market share – Client and Server version – Quality
• JRockit – Value adds • JRockit Mission Control • JRockit Flight Recorder • JRockit Virtual Edition
– Optimized for the Oracle stack
21
Convergence
1 + 1 = 3 ?
22
Convergence
JRockit Hotspot HotRockit
23
Official roadmap, from JavaOne 2010
• JDK 7 – 2011 • JDK 8 – 2012 • Open JDK unchanged • JVM Merge -> Open JDK • JDK/JRE still free, same terms on license • Premium – (Such as: JFR, JRMC, JFB, Support)
24
JDK 7 Features (Partial List) http://openjdk.java.net/projects/jdk7/features/
• JSR 292: Support for dynamically typed languages • Strict class-file checking • JSR 334: Small lang enhancements (Project Coin) • Upgraded Class Loader Architecture • Concurrency and collections updates • Unicode 6.0 • JSR 203: More new IO APIs • NIO.2 • Stream Control Transmission Protocol • Sockets Direct Protocol • Elliptic-curve cryptography (ECC)
25
JDK 8 Planning
• JSR 294: Language and VM support for modular programming • JSR 308: Annotation on Java Types • JSR TBD: Language support for collections • JSR TBD: Project Lambda (closures) • Modularization (Project Jigsaw) • Swing Application Framework • Swing JDatePicker component
26
Java SWOT – Oracle
Strengths • Most used programming language • Garbage collection • Community driven • Adaptive runtime • Write once… • Strong community • High performance
Weaknesses • No new releases • Steward out of cash • No good Smart phone story
Opportunities • Multi Core • JVM interop • Cloud
Threats • Next big thing • Walled garden platforms • Not attractive to new developers • Uncertain future • Bad name in community
27
Future
28
What’s Coming
29
Switching Gears
• Oracle Java Embedded Client – CVM, CDC JRE
• Embedded SE – Hotspot, SE JRE
30
Java Everywhere
31
The Spectrum of Java
Servers Desktop Embedded TV Mobile Card
Java Language
Java SE Java ME Java Card
Java EE Java TV
BD-J
JavaFX MSA
32
Switching Gears
• Oracle Java Embedded Client – CVM, CDC JRE
• Embedded SE – Hotspot, SE JRE
33
How to Choose
• Oracle Java Embedded Client – CVM, CDC JRE – Best when • Low static footprint • Low use of dynamic memory • Very portable across processor/OS combinations
• Embedded SE – Hotspot, SE JRE – Best when: • High throughput • Full SE API set
34
Introducing Oracle Java ME Embedded Client • Industry leading, best-in-class CDC JVM
• Version 1.0 to be released in Q2 CY2011 • Connected Device Configuration 1.1.2 • Foundation Profile (FndP) 1.1 • Personal Basis Profile (PBP) 1.1 • Optional packages: Web Services (JSR-172) ,
JDBC (JSR-169), RMI (JSR-66)
• High performance and reliability with low memory footprint
• Java SE subset • Static (CDC 1.1.2 headless): 3.5MB • Dynamic: Typical RAM 8MB and up
35
Oracle Java ME Embedded Client Overview
• Optimized for resource constrained devices • Ported to multiple Processors / OS / Graphics • Mass deployments in industrial and consumer devices • Available in binary and source
36 36
Oracle Java ME Embedded Client Release 1.0
Linux Arm v5/v6/7 Linux MIPS Linux PPC
Linux x86 Windows x86
Headless Stack Headful and SDK
37 37
• Target runtime binary • ARM v5/v6/v7, MIPS, PowerPC Linux Headless • Install Guide, User Guide, Release Note
• SDK in Windows and Linux • Starter kit - step by step guide to creating a new Java embedded system
• White paper – link to “How To” guide • How to get Linux running on the BeagleBoard • How to install JEC, use the NetBeans plug-in, access the USB, connect to the network, log data, access sensors, install and use a web server, etc. • Sample code/app and how to build a simple app
• Dev board – link to Beagle board vendor • Tools – link to NB plug-in
Oracle Java ME Embedded Client What is included in 1.0?
38
• Fast startup time • Romization • Ahead of time Compiler (AOT) • Multiple application support (mTask)
• Low power handling, optimized battery power • Fast dynamic compiler
• Tunable and easily retargetable • Native calling
• Fast native calling with CNI • CLDC/MIDP support with KNI • JNI
Oracle Java ME Embedded Client Major Features (1)
39
• Portability • JIT & OS Porting layer • Service Provider API • Easy porting and re-targetable to different OSs & CPUs • Direct calls to HW for optimization • Almost entirely in C • Portable to compilers that don’t support 64-bit longs
• Pluggable architecture • Java compatibility
• JVM and JLS compliant • Proper subset of Java SE API
• Industrial standards • OSGi, BD-J, GEM/MHP, OCAP, Ginga-J
• Portion of library code optimized for small devices
Oracle Java ME Embedded Client Major Features (2)
40
• “Hardened” system • Resource Management, Memory Allocator • Fail gracefully • Well tested in low resource conditions
• Ordered shutdown and re-startability • ThreadControl • Clean shutdown and re-start • Re-Initialize correctly on VM re-start
• JVMTI support • Multi core support • MIDP/MSA support • Pluggable Graphics architecture • Leverage OS capabilities (e.g. processes for mtask)
Oracle Java ME Embedded Client Major Features (3)
41
• Java API and language to SE 6 subset • New languages features • New API packages (Security, NIO, Logging, Annotations, GCF,
Unicode) • Enhancements
• X86 JIT added • 32 bit typeid support • Improved Symmetric Multiprocessing support • Multitasking support • Memory management support • Graphics acceleration support, OpenGL ES • Runtime Romization for application startup time
Oracle Java ME Embedded Client Additional features under consideration
42
Switching Gears
• Oracle Java Embedded Client – CVM, CDC JRE
• Embedded SE – Hotspot, SE JRE
43
Java: The Best Platform for Embedded Applications
Decouples software development from hardware development cycle
Development and testing can be done (mostly) using standard desktop systems
Highly productive language, APIs, runtime, and tools mean quick time to market
Create high-performance, portable, secure, robust, cross-platform applications easily
Java isolates your apps from language and platform variations (e.g. C/C++, kernel, libc differences)
1
2
3
6
7
8
9
Most popular embedded processors supported allowing design flexibility Support for key embedded features (low footprint, power mgmt., low latency, etc)
Leverage huge Java developer ecosystem (expertise, existing code)
Easily create end-to-end solutions integrated with Java back-end services
Solutions from constrained devices to server-class systems
4
5 10
44
SE for Embedded Product Overview Two groups of product offerings
• For Desktops/Servers AND Embedded – Standard Releases and Platforms: x86, x64, Sparc® (32 and 64 bit) Linux, Windows, Solaris – On the web, regular updates
• For Embedded ONLY – Additional platforms: ARM, PowerPC, XP-Embedded – Additional features: Headless/Small Footprint, Memory Optimizations, Low Memory Handling, Power Savings – On the web, transitioning to regular updates
• Wide range of platforms supported (30+ ISA/OS sets) • Development is free
– Deployment requires commercial licensing
45
Java SE for Embedded Example devices
• ATMs • Parking Meters • POS Systems • Lottery/Gaming
Systems • Multi Function Printers • Intelligent Power
Module • Netbooks
• Routers & Switches • Storage Appliances • Network Management
Systems • Medical Imaging Systems • Radar Systems • Industrial PCs • Factory Automation Systems • Geo-Imaging Devices
• Smart Meters • RFID Readers • Video Conferencing
Systems • In-Flight Entertainment
Systems • Video Streaming Systems • Electronic Voting
Systems • Voice Messaging
Systems • Security Systems
46
Java SE Embedded in Smart Metering
EnergyICT Java SE Embedded Based Smart Meter Concentrator
47
Current Java SE Embedded Offerings SE 6u25 – latest release available on web Apr 21, 2011 NEW
Processor Operating System
Headless or Headful FPU Java SE
Version
ARMv5 Linux Headless SFLT 6u25
ARMv6/v7 Linux Headless & Headful (v7) VFP 6u25
PowerPC e600 core Linux Headless Classic HW
FP 6u25
PowerPC e500v2 core Linux Headless Embedded
FP 6u25
x86 Linux Headless X86 6u25
* All configurations dynamically detect and support single or multi-core processors
48
Java SE for Embedded 6u21 Release (Nov 1, 2010) Started the sync of SE Embedded with SE
• Major update for embedded platforms Updated PowerPC and x86 releases from 5u10 to 6u21 Updated ARM releases from 6u10 to 6u21 Reduced SE/SE-Embedded release gap to 4 months
• Expanded Multi-Core Support • Added multi-core support for ARM and PowerPC
• Additional Platform Support • Added support for PowerPC e500v2
• Improved Performance/Benchmarks • SPECjvm98 improvements: ARM 10%; PPC 19%, x86 17% • ~20% improvement in CaffeineMark on all SE-E 6u21 • ~2x the performance of Android on common benchmarks
49
Java SE for Embedded 6u25 Release (Apr 21, 2011) Completed the sync of SE Embedded with SE
• Full SE 6 Alignment • Sync'd most popular Java embedded platforms with
latest SE release • ARM (v5, v6, v7), PowerPC (e600, e500v2) and X86 • Shipped simultaneously as SE 6u25
• Rich set of features and APIs of SE 6u25 and the hundreds of enhancements, security improvements and bug fixes now available to embedded
• Multi-core support of Java SE such as parallel GC and background JIT compilation are available for growing use of multi-core in embedded
• Allows developers to deploy on their embedded device the same Java SE version they develop with on their PC.
•
50
Embedded CaffeineMark Performance Improvements
+29%
+22%
+21%
51
specJVM98 Performance Improvements
+19%
+17%
52
2.17X
2.6X 1.53X
2.15X
Beagleboard Specs TI OMAP3530 CPU Cortex-A8 256MB RAM 600Mhz
* Chart is displaying relative performance differences only. Scores have been proportionately scaled to fit on chart.
53
2.5X
3.2X 2X
* Chart is displaying relative performance differences only. Scores have been proportionately scaled to fit on chart.
Tegra-2 Specs ARM Cortex-A9 Dual-Core CPU 1GB RAM 1GHZ
54
<Insert Picture Here>
Outline
• SE Embedded Background – Java intro – SE Embedded product overview
• Tips for using SE Embedded – Getting started – Tuning Java SE – Improving startup – Garbage collector selection – Reducing resource requirements
• Trends, Futures • Resources • Q & A
55
Getting Started • Purchase Embedded Device
• Many low cost ARM single and multi-core devices • Single Core ARM Cortex-A8 devices
• SheevaPlug ($99) http://www.plugcomputer.org • BeagleBoard ($149) http://beagleboard.org
• Multi-Core ARM Cortex-A9 devices • PandaBoard ($174) http://pandaboard.org • Nvidia Tegra 250 Developer Kit ($399) http://developer.nvidia.com/tegra/tegra-devkit-features
• You’ll need USB Keyboard, Mouse and HDMI Video monitor • Download / Install / Setup Linux Distribution
• Some vendors provide pre-installed ready-to-go Linux distros. Special Computing does this for Beagleboard and Pandaboard http://specialcomp.com
• Download and un-tar Java SE Embedded • http://oracle.com/technetwork/java/embedded
56
Sample Embedded ARM Devices Beagleboard
http://beagleboard.org Plug computer
http://www.plugcomputer.org Pandaboard
http://pandaboard.org
Beagleboard Specs TI OMAP3530 CPU Cortex-A8 256MB RAM 600Mhz
Pandaboard Specs TI OMAP4430 CPU Dual Core Cortex-A9 1GB RAM 1Ghz
Plug Computer Specs Marvell ARMv5 CPU 512MB RAM 1.2ghz
57
Java SE Embedded Platform Example GuruPlug
Low Power ARM/Linux based device design by Maxwell 512 MB RAM, 512 MB Flash, USB & Gigabit Ethernet Approx $100-120 for single devices Flexible and Capable Runs Java SE Arm v5/Linux headless Low Power Java Web Server: http://www.theregister.co.uk/2010/11/11/diy_zero_energy_home_server/
58
Tuning your Embedded Java Solution • Default configuration • Improving Startup Time • Taking Advantage of Multi-core processors • Picking the Right Garbage Collector
Heap Size
Memory Consumption
Startup Time
Disk/Flash Consumption
JIT Strategy
Garbage Collection Policy
Throughput/Response Time
Clock Speed, Number of CPUs
59
Java SE Embedded Design Focus
• Assumptions leading to our default configuration of SE Embedded – Most embedded devices are resource constrained – Keeping per unit device cost low is high priority – Use lower clocked processors
Option Java SE Embedded
Default State Performance Monitoring Off by Default Compression of JAR Files All Jar File Compressed All JRE Files Included Optional Files Removed Class Data Sharing Off by Default JIT Compiler Only –client JIT available
60
Improving Startup Time
• Class Data Sharing (If classloading is bottleneck) – Enabling Class Data Sharing – Customizing Class Data Sharing Archive – Can improve Startup by 25%-30%
• Uncompressing jar files (If disk space is available) – Gain is dependent on disk access and CPU clock speed
• Lower Compilation Threshold (If MP device) -XX:CompilationThreshold=xxxx (default is 1500)
• Deferring Initialization or Class Loading in your application
61
Enabling and Configuring Class Data Sharing
• Enabling CDS with default classlist
java –Xshare:dump Once complete, CDS is automatically enabled • Use java –Xshare:on OR –Xshare:off to compare
startup times. • The default classlist is for GUI Swing Based Apps
62
Customizing Class Data Sharing for Embedded Java Applications
1. Create a list of classes loaded at the startup of your application java –Xshare:off –XX:+TraceClassLoadingPreorder {your app}
>my_class_list *exit your app soon after startup 2. Extract only bootclass loaded classes. Outputs classlist.linux. java MakeClassList my_class_list >new_classlist 3. Add checksum to end of new_classlist java AddJsum new_classlist classlist 4. Copy classlist to {JRE}/lib directory 5. Create classes.jsa file java –Xshare:dump You now have a customized classes.jsa file!
Tools referenced on this page can be found in openjdk sources here: jdk/make/tools/src/build/tools
63
Taking Advantage of Multi-Core Processors with Java
• Built in VM Features that take advantage of SMP – Parallel Garbage Collection – Concurrent Garbage Collection – Background JIT Compilation • Lower Compilation Threshold
• Parallelize your Java Application Code
64
Which Garbage Collector Should I Use? Java SE Embedded Contains all of the standard collectors
For more details on GC tuning options see: http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html
Collector Option Pro Con MP
Serial -XX:+UseSerialGC (default)
Best Choice for single CPU
N
Concurrent -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode
Better if response time is highest priority Shorter GC pauses
Uses processor resources while embedded app is running
Y
Parallel (Young) Parallel (Old)
-XX:+UseParallelGC -XX:+UseParallelOldGC
Better if throughput is highest priority. Uses multiple processors to speed up GC collection
GC must still pause embedded app during collections.
Y
65
Reducing System Resource Requirements (Reducing Memory Consumption)
• Customizing Heap Sizes -Xms -Xmx
• Adjust Free Ratios -XX:MaxHeapFreeRatio=xx (control heap reduction, default 70) -XX:MinHeapFreeRatio=xx (controls heap expansion, default 40)
• Reducing JIT CodeBuffer -XX:ReservedCodeCacheSize=xxM
• Standard Java SE tools can be used to identify potential memory savings – Use jvisualvm with Linux x86 JDK
• Heapdump option
66
<Insert Picture Here>
Outline
• SE Embedded Background – Java intro – SE Embedded product overview
• Tips for using SE Embedded – Getting started – Tuning Java SE – Improving startup – Garbage collector selection – Reducing resource requirements
• Trends, Futures • Resources • Q & A
67
Embedded Microprocessor Trends
• Embedded systems getting more powerful • Multi-core is everywhere • Intel pushing into embedded with Atom; ARM plans to go after server appliances • Net: Great opportunity for Java SE Embedded
• Cortex A5 Dual Core • Cortex A9 Dual/Quad Core
• 250mw power 1ghz today • ARM Eagle Cortex A15 Coming
• Quad 2.5 ghz! • Nvidia Tegra 2 – 1ghz Dual A9 • Marvell Quad-Core • TI OMAP4 Dual core Cortex-A9
Common Themes
• PowerPC QorIQ Family • P2020 Dual Core 1.2ghz • P4080 Quad Core 1.5ghz
Embedded Communication Processors
• Atom Dual Core Processors • N550 1.5ghz 8.5w • D525 1.8ghz 13w • D510 1.66ghz 13w • 330 1.6ghz 8w
68
SE Embedded Futures
• Track SE releases closely • SE 7 Highlights
• Mid-2011 • JSR 292 -InvokeDynamic • Project Coin (small language changes)
• SE 8 Highlights • End-2012 • Project Lambda – Closures • Modularity
• Performance, startup and size reduction always top priority • Bundled solutions for specific markets e.g.
• Berkeley DataBase
69
Embedded SE, BDB, Mobile Sync Client/Server, 11g
Linux eSE BDB
Sync Client Temp App
Windows SE
11g
Sync Server
insert_record(temperature);!
70
71
Resources
• Oracle Embedded Java Products • http://oracle.com/technetwork/java/embedded
• Java SE Home • http://oracle.com/technetwork/java/javase
• Java ME Home • http://oracle.com/technetwork/java/javame
• The Java Spotlight Podcast • http://thejavaspotlight.org
• Follow @Java on Twitter
72
<Insert Picture Here>
Questions?
For more information on Java SE for Embedded:
www.oracle.com/technetwork/java/embedded