8/3/2019 TS-2023
1/38
2007 JavaOneSM Conference | Session TS-2023 |
TS-2023
Whats Hot in IBMs VirtualMachine for the Java
Platform2007 Edition?Trent Gray-Donald
Java SE JVM Technical LeadIBMwww.ibm.com/java/jdk
8/3/2019 TS-2023
2/38
2007 JavaOneSM Conference | Session TS-2023 | 2 Copyright IBM Corp. 2006, 2007
Goal
Learn about IBMs Java Virtual Machine
(JVM
) offerings, see whats improvedtechnically on the way to Java platformv.6, and a dive into IBMs Real-time Java
technology offering.
Whats in It for You?
The terms Java Virtual Machine and JVM mean a Virtual Machine for the Java platform.
8/3/2019 TS-2023
3/38
2007 JavaOneSM Conference | Session TS-2023 | 3 Copyright IBM Corp. 2006, 2007
Agenda
History and ArchitectureJava Platform v.6Whats New This Year?
JVM Software, GC, JIT, Shared Classes
RAS Update
WebSphere Real Time and Metronome GCReal-time Specification for Java (RTSJ):
Java Specification Request (JSR) 1
8/3/2019 TS-2023
4/38
2007 JavaOneSM Conference | Session TS-2023 | 4 Copyright IBM Corp. 2006, 2007
Agenda
History and ArchitectureJava Platform v.6Whats New This Year?
JVM Software, GC, JIT, Shared Classes
RAS Update
WebSphere Real Time and Metronome GCReal-time Specification for Java (RTSJ):
Java Specification Request (JSR) 1
8/3/2019 TS-2023
5/38
2007 JavaOneSM Conference | Session TS-2023 | 5 Copyright IBM Corp. 2006, 2007
Design Philosophy andArchitecture
Current offerings based on the J9 Virtual Machine
3rd generation JVM software from IBM
Designed from the ground up to be a scalable solution forembedded, desktop, and server class hardware
Common code base for all Java Platform, Micro Edition(Java ME platform) and Java Platform, Standard Edition(Java SE platform) products
Highly configurablepluggable interfaces with differentimplementations depending on the target market
Class library independence
Supports latest language features (Java SE v.6)
Scaling to available hardware
Wide rangefrom a watch to a mainframe Portable, configurable, flexible
8/3/2019 TS-2023
6/382007 JavaOneSM Conference | Session TS-2023 | 6 Copyright IBM Corp. 2006, 2007
Pluggable components
that dynamically load
into the virtual machine Calls to
C
Libraries
JavaSE 6
Operating System
Native
Applications
Java Application Code
OS-Specific Calls
Virtual Machine
Java SE 5
Garbage collector
Interpreter
Exception handler
Class loader
Thread Model
JVM Profiler
Debugger
Realtime Profiler
Port Library (file IO, sockets, memory allocation, etc.)
Uses 1 of many possible
configurations
JCL Natives
JNI
CDC
MIDP
Java calls
JNI
JIT
CLDC
Class
Library
JNI = Java Native Interface
8/3/2019 TS-2023
7/382007 JavaOneSM Conference | Session TS-2023 | 7 Copyright IBM Corp. 2006, 2007
Agenda
History and ArchitectureJava Platform v.6Whats New This Year?
JVM Software, GC, JIT, Shared Classes
RAS UpdateWebSphere Real Time and Metronome GC
Real-time Specification for Java (RTSJ):Java Specification Request (JSR) 1
8/3/2019 TS-2023
8/382007 JavaOneSM Conference | Session TS-2023 | 8 Copyright IBM Corp. 2006, 2007
All thats new
Java Platform v.6
Standard Java SE platform v.6 classlibrary enhancements java.util.concurrent updates (and lock monitoring)
JVM technology enhancements JVM Tool Interface 1.1 (multiple agents,
better heap iterator API,)
Class loading performance boost
8/3/2019 TS-2023
9/382007 JavaOneSM Conference | Session TS-2023 | 9 Copyright IBM Corp. 2006, 2007
Customer FeedbackResulting in Process Changes
Java platform v.5 and before => closedbeta program
Java platform v.6 => open early access program
Move to iterative development model
8/3/2019 TS-2023
10/382007 JavaOneSM Conference | Session TS-2023 | 10 Copyright IBM Corp. 2006, 2007
Just in Time (JIT) compiler updates
Java Platform v.6
POWER 6
and Z9 exploitation Inliner and basic block layout improvements
Determine whats hot, whats not
(common path analysis) Lock reservation (IBM paper at OOPSLA 02)
Improves scaling and overall performance
Dozens of platform dependent and independentoptimizations implemented, (e.g., new registerallocators, live range reduction, idiom recognition)
8/3/2019 TS-2023
11/382007 JavaOneSM Conference | Session TS-2023 | 11 Copyright IBM Corp. 2006, 2007
Garbage Collector (GC) updates
Java Platform v.6
Significantly faster classLoader load/unload performanceand improved footprint
Hierarchical Scanningfaster, memory hierarchy awareoptimization forXgcpolicy:gencon. Paper in ISMM 06
(Siegwart and Hirtzel) Challenge: improving locality
Commercial workloads spend 45% stalled in memory requests.
Copying GC can improve object ordering, co-locating
objects on the same page or cache line
While maintaining scalability
Parallelism and workload balancing is essential
for server workloads
8/3/2019 TS-2023
12/382007 JavaOneSM Conference | Session TS-2023 | 12 Copyright IBM Corp. 2006, 2007
0%
5%
10%
15%
20%
25%
30%
1 2 3 4 5 6 7 8 9 1011 12 131415 16 171819 202122 23242526
Scanned Slot to Copied Object Distance
(Log2)
Propo
rtion
Breadth-FirstHierarchical
64 byte
cache line
page size (4 kB) less TLB misses, less L2 cache misses
Parent-Child Distances forHierarchical(SPECjbb2005)
8/3/2019 TS-2023
13/382007 JavaOneSM Conference | Session TS-2023 | 13 Copyright IBM Corp. 2006, 2007
Memory Management/Garbage Collection
Minor collectiontakes place only in the young generation,normally done through direct copying => very efficient
Major collectiontakes place in the new and old generationand uses the normal mark/sweep (+compact) algorithm
How the IBM J9 generational garbage collector works
IBM J9: Xmn (-Xmns/-Xmnx)
Sun:
XX:NewSize=nn
XX:MaxNewSize=nn Xmn
Sun JVM Software Only: XX:MaxPermSize=nn
Nursery/Young Generation Old Generation Permanent Space
IBM J9: Xmo (-Xmos/-Xmox)
Sun:
XX:NewRatio=n
8/3/2019 TS-2023
14/382007 JavaOneSM Conference | Session TS-2023 | 14 Copyright IBM Corp. 2006, 2007
Understanding Heap Sizes
occupied
free
-Xmx = max
-Xms = initial
Hint: Use -verbose:sizes to see defaults for your platform, * denotes default
GC resizes heap based on occupancy
and duration statsOccupancy Constraint:
30%* < free < 60%*
-Xminf< free < -Xmaxf
Duration Constraint:
5%* < duration < 13%*
-Xmint < duration < -Xmaxt
Adjustment Size:
1Mb* < adjustment < *
-Xmine < adjustment < -Xmaxe
8/3/2019 TS-2023
15/382007 JavaOneSM Conference | Session TS-2023 | 15 Copyright IBM Corp. 2006, 2007
Overview
Java Platform v.6SharedClasses
Target: server environments where multipleJVM implementations exist on the same box
Goal: improve startup time and memory footprint
Sharing of common data For classes, granularity is .class file
Multiple sharing strategies Standard classloaders (including application
Classloader) exploit the feature when enabled
API to extend custom ClassLoaders available
8/3/2019 TS-2023
16/382007 JavaOneSM Conference | Session TS-2023 | 16 Copyright IBM Corp. 2006, 2007
Improvements
Java Platform v.6Shared Classes
Pre-compilation of Java code Idea: JIT the code ahead of time (during first run)
and share it from then on
Result: improved startup time Shared classes is becoming
Shared JVM software data
Other JVM software data will be stored in future
8/3/2019 TS-2023
17/382007 JavaOneSM Conference | Session TS-2023 | 17 Copyright IBM Corp. 2006, 2007
Sharing helps speed up JVM software start-up
Java Platform v.6Shared Classes
Startup Improvements with Shared Classes and AOT
0
5
10
15
20
25
30
eclipse 3.2.2 tomcat 5.5 WAS 6.1
Seconds
default
-Xshareclasses
(Java 5.0)"
-Xshareclasses
(Java 6.0)
Lower is better
8/3/2019 TS-2023
18/382007 JavaOneSM Conference | Session TS-2023 | 18 Copyright IBM Corp. 2006, 2007
Cluster Server Memory Savings forv6.1
With the addition of the Shared Classes feature to the IBM Java Development Kit (JDK)WebSphere instances are able to share non-changing class files amongst each other limiting thememory overhead of each JVM machine
Typically for a base WebSphere install each JVM machine uses about 30MB less memory withShared Classes on its process size
-9
27
62
79
102
0
100
200
300
400
500
600
700
One Two Three Four Five
ProcessSize(MB)
-20
0
20
40
60
80
100
120
MemorySav
ed(MB)
Shared Classes Enabled Clustered Server Memory Footprint (bytes)Regular Clustered Server Memory Footprint (bytes)Memory Saved with class sharing
8/3/2019 TS-2023
19/382007 JavaOneSM Conference | Session TS-2023 | 19 Copyright IBM Corp. 2006, 2007
Agenda
History and Architecture
Java Platform v.6Whats New This Year?JVM Software, GC, JIT, Shared Classes
RAS UpdateWebSphere Real Time and Metronome GC
Real-time Specification for Java (RTSJ):Java Specification Request (JSR) 1
8/3/2019 TS-2023
20/382007 JavaOneSM Conference | Session TS-2023 | 20 Copyright IBM Corp. 2006, 2007
Reliability,Availability, andServiceability
Centralization of tools Central customer visible repository of supported, maintained tools
Extensible, open tools, with programmable extension interfaces
Tools must be usable everywhere
GUI mode for interactive use
Report generation for headless environments
Documentation
Improvements to problem determination doc
Aggregated search in IBM support assistant
Iterate!
Tools being deployed very regularlylooking forcustomer feedback
RAS strategy
8/3/2019 TS-2023
21/382007 JavaOneSM Conference | Session TS-2023 | 21 Copyright IBM Corp. 2006, 2007
Improvements across releases
Reliability,Availability, andServiceability
IBM Support Assistant
Java platform 1.4.2, Java platform v.5, and (soon)Java platform v.6 plug-ins
Diagnostics Tooling Framework For Java (DTFJ) Presented at the 2006 JavaOneSM conference
DumpAnalyzer (using DTFJ)
First stop analysis engine for common Java problems(OutOfMemoryError and crashes)
Extensible Verbose ToolKit (EVTK)
Verbose GC visualization and analysis
8/3/2019 TS-2023
22/38
2007 JavaOneSM Conference | Session TS-2023 | 22 Copyright IBM Corp. 2006, 2007
8/3/2019 TS-2023
23/38
2007 JavaOneSM Conference | Session TS-2023 | 23 Copyright IBM Corp. 2006, 2007
EVTKHeap Visualization
Heap occupancy
Pause times
8/3/2019 TS-2023
24/38
2007 JavaOneSM Conference | Session TS-2023 | 24 Copyright IBM Corp. 2006, 2007
EVTKComparison and Advice
Compare runs
Performance advisor
8/3/2019 TS-2023
25/38
2007 JavaOneSM Conference | Session TS-2023 | 25 Copyright IBM Corp. 2006, 2007
IBM SDK for Java Platform v6Early Release Program
Download early release software packagesand documentation from the program website https://www14.software.ibm.com/iwm/web/cc/
earlyprograms/ibm/java6/
Participate in technical discussion on anIBM-moderated forum
The early release version of the IBM SDKis available on Linux, IBM AIX, Linux onSystem z, and IBM z/OS
8/3/2019 TS-2023
26/38
2007 JavaOneSM Conference | Session TS-2023 | 26 Copyright IBM Corp. 2006, 2007
Agenda
History and Architecture
Java Platform v.6Whats New This Year?JVM Software, GC, JIT, Shared Classes
RAS UpdateWebSphereReal Time and Metronome GC
Real-time Specification for Java (RTSJ):
Java Specification Request (JSR) 1
8/3/2019 TS-2023
27/38
2007 JavaOneSM Conference | Session TS-2023 | 27 Copyright IBM Corp. 2006, 2007
What Does Real-Time Mean?
Real-time = Predictability of performance
HardViolation of timing constraints are hard failures
SoftTiming constraints are simply performance goals
Constraints vary in magnitude (microseconds to seconds)
Consequences of missing a timing constraint:
From service level agreement miss (stock trading)
To life in jeopardy (airplanes)
Real-fast is not real-time, but real-slow is not real-good
Need a balance between predictability and throughput
8/3/2019 TS-2023
28/38
2007 JavaOneSM Conference | Session TS-2023 | 28 Copyright IBM Corp. 2006, 2007
WebSphereReal Time (WRT)
1.0 generally available in August 2006
WRT is a Java technology runtime providinghighly predictable operation
Real-time garbage collection Static and dynamic compilation
Full support for RTSJ (JSR 1)
Java SE platform 5.0 compliant Built and rigorously tested on a RT Linux OS
with IBM System x blades
8/3/2019 TS-2023
29/38
2007 JavaOneSM Conference | Session TS-2023 | 29 Copyright IBM Corp. 2006, 2007
Linux Support for Real-Time
WebSphere Real Time runs on a variant of RHEL 4.2 Updated Linux kernel (2.6.16+)
Pre-emptive Kernel (priority inheritance in kernel locks)
High precision timing (precise microsecond sleep)
Extended POSIX APIs (priority-based pthreads)
Supported on key System x platforms by the IBM LTC
Primary target is the System x blades
Goal is to have changes adopted into the Linux kernel Changes maintained and incorporated into distributions
8/3/2019 TS-2023
30/38
2007 JavaOneSM Conference | Session TS-2023 | 30 Copyright IBM Corp. 2006, 2007
Real-Time Garbage Collection
Gencon can provide low pause time GC But the pauses are not predictable
Time-bound work items can potentially fail
Application
Collector
Time
Systems with real-time requirements can fail Unpredictable behavior characteristics
Sufficient time to complete Insufficient time to complete
The metronome garbage collector
8/3/2019 TS-2023
31/38
2007 JavaOneSM Conference | Session TS-2023 | 31 Copyright IBM Corp. 2006, 2007
Real-Time Garbage Collection
Metronome targets short individual pauses 500us average with 1ms upper bound
However, short pause times arent enough
Need a system that incorporates Short pause times
Time ratios between the application and GC
Application
Collector
Time
0.1ms1ms
The metronome garbage collector
This is no better than a full collection!
8/3/2019 TS-2023
32/38
2007 JavaOneSM Conference | Session TS-2023 | 32 Copyright IBM Corp. 2006, 2007
Real-Time Garbage Collection
Utilization Percentage of time dedicated to the application
in a given window of time
Metronome uses a 10ms sliding windowto measure utilization
Utilization is user selectable via command line
The metronome garbage collector
Application
Collector
Time
Application receives a minimum
percentage of time to run10ms
8/3/2019 TS-2023
33/38
2007 JavaOneSM Conference | Session TS-2023 | 33 Copyright IBM Corp. 2006, 2007
Real-Time Garbage Collection
Utilization is not free!
There are tradeoffsfor higher utilization
Heap size vs.throughput
Finding the right
balance will dependon user andapplication needs
90% 65%
100mb 50mb
The metronome garbage collector
8/3/2019 TS-2023
34/38
2007 JavaOneSM Conference | Session TS-2023 | 34 Copyright IBM Corp. 2006, 2007
Real-Time Garbage Collection
Predictable pause times are not free! There is an impact on throughput
Frequent context switching between applicationand GC threads
Allocation of objects is more complicated Arrays in particular
Tracking of potential hidden objects
Effects of RTSJ overhead are also felt The strength of the system is predictability
The cost of predictability
8/3/2019 TS-2023
35/38
2007 JavaOneSM Conference | Session TS-2023 | 35 Copyright IBM Corp. 2006, 2007
100% Java technology MIDI Synthesizer
1 ms (1KHz) timing for MIDI control (GC)44.1KHz for waveform synthesis (Eventrons)
Joint work with Bohm Software
Autonomous Quad Rotor Helicopter100% Java technology, 3ms control loop
Goal is to validate Java technology in a
critical physical control system
Joint work with University of Salzburg
Application Test Beds
8/3/2019 TS-2023
36/38
2007 JavaOneSM Conference | Session TS-2023 | 36 Copyright IBM Corp. 2006, 2007
Further Information
IBM JDK home page http://www.ibm.com/developerworks/java/jdk/
IBM support assistant
http://www.ibm.com/software/support/isa/ Early access program
https://www14.software.ibm.com/iwm/web/cc/earlyprog
rams/ibm/java6/ WebSphere Real Time
http://www-306.ibm.com/software/webservers/realtime/
8/3/2019 TS-2023
37/38
372007 JavaOneSM Conference | Session TS-2023 |
Q&ATrent Gray-Donald
8/3/2019 TS-2023
38/38
TS-2023
Whats Hot in IBMs VirtualMachine for the Java
Platform2007 Edition?Trent Gray-Donald
Java SE JVM Technical LeadIBMwww.ibm.com/java/jdk