View
219
Download
0
Category
Preview:
Citation preview
© 2008 IBM Corporation
IBM Java Technology Centre
Exploring IBM Java 6 - New Features and Enhancements
Trent Gray-DonaldSenior Technical Staff Member –Java Virtual Machine
March 4, 2008
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Goal
Learn about IBM’s Java™ Virtual Machine (JVM™) offerings, see what’s improved technically on the way to Java platform v.6, and have a peek at some of our serviceability tools.
What’s in It for You?
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Agenda
History and ArchitectureJava Platform v.6—What’s New This Release?
Java 5 platform updates
Java 6 class library updates
JVM Software
Garbage Collection
JIT
Shared Classes
Serviceability Update
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Agenda
History and ArchitectureJava Platform v.6—What’s New This Release?
Java 5 platform updates
Java 6 class library updates
JVM Software
Garbage Collection
JIT
Shared Classes
Serviceability Update
5
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
IBM and Java
Java is critically important to IBM– As an fundamental infrastructure for our own software portfolio including
WebSphere and Rational products.
IBM is investing strategically in Java and in virtual machines– The transition to our next generation virtual machine base was completed
successfully in the Java SE 5.0 release.
– We expect to accelerate innovation in performance, reliability and serviceability going forward.
IBM is also looking to engender accelerated public innovation in Java
– Support of Eclipse, Apache (XML, Derby, Geronimo, Harmony, Tuscany, …)
– Broad participation in relevant open standards bodies such as JCP, OSGi
6
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
IBM’s Approach to Java Technology
ReferenceJava
Technology(Sun, OSS,
Others)
IBMJava
IBM JavaTechnology
Centre
Listen to and act upon market Listen to and act upon market requirementsrequirements
World class service and supportWorld class service and support Available on more platforms than any Available on more platforms than any
other Java implementationother Java implementation Highly optimizedHighly optimized Embedded in IBM’s middleware Embedded in IBM’s middleware
portfolio and available to ISV partnersportfolio and available to ISV partners
Quality EngineeringPerformance
SecurityReliability
Serviceability
Production RequirementsIBM Software Group
IBM eServerISVs
IBM Clients
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Current offerings based on the J9 Virtual Machine– 3rd generation JVM software from IBM
– Designed from the ground up to be a scalable solution for embedded, 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 configurable—pluggable interfaces with different
implementations depending on the target market Class library independence Supports latest language features (Java SE v.6) Scaling to available hardware
– Wide range—“from a watch to a mainframe”
– Portable, configurable, flexible
Design Philosophy and Architecture
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Pluggable components that dynamically load into the virtual machine Calls to
CLibraries
JavaSE 6
Operating System
NativeApplications
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
CDCMIDP
Java calls
JNI
JIT
CLDCClass
Library
JNI = Java Native Interface
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Agenda
History and ArchitectureJava Platform v.6—What’s New This Release?
Java 5 platform updates
Java 6 class library updates
JVM Software
Garbage Collection
JIT
Shared Classes
Serviceability Update
10
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Java 5.0 Language Features Compile-Time Type Safety with Generics
– Similar to C++ templates– e.g. Vector<String>
Extended Syntax for for loops– Makes iterating over collections easier. Similar to for each in other languages.– void cancelAll(Collection<Tasks> tasks) { for (Task t : tasks)
t.cancel(); }
Auto-Boxing of Primitive Types– Automatic conversion of primitive types (e.g. int) to boxed equivalent (e.g. java.lang.Integer).
Typesafe Enumerations– An alternative to static, final constants. – e.g. enum Seasons { WINTER, SPRING, SUMMER, FALL}
Annotations: Language Metadata– Modifiers can be added to most language elements, and is available at runtime.– Allows semantic markup of programs for documentation, registration, etc.
Library enhancements for concurrency, management, JVMTI
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Standard Java SE platform v.6 class library enhancements– java.util.concurrent updates (and lock monitoring)
– Collections framework
– Java.lang.instrument – class redefinition
Base JVM technology enhancements– JVM Tool Interface 1.1 (multiple agents,
better heap iterator API, instrumentation of native methods…)
– Class loading performance boost
– New class file data improves verification time
All that’s new…
Java Platform v.6
12
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
java.util.concurrent
Building scalable data structures is HARD… really hard!– Need to deeply understand concurrency and thread models.
– Low level hardware details dramatically affect performance
– Bugs are typically hard to shake out and irreproducible.
Java now provides very solid building blocks– Task scheduling (Executor framework)
– Concurrent collections (fast and scalable implementations of Map, List, Queue)
– Atomic variables (atomic math ops such as increment, test and set.)
– More variety in locking operations (tryEntry, multiple condvars)
Please use these libraries! (for everyone’s sanity.)
Great performance opportunities…
13
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Testarossa JIT: Dynamic, adaptive, optimizing compiler
Dynamic– Triggered at runtime based on projected profitability of compilation– Compiled methods can be freely intermixed with interpreted callers/callees– May have multiple versions of methods built with different levels of optimization
Adaptive– Sensitive to need for program to have CPU (e.g. throttled during startup, runs on asynchronous
thread )– Able to profile program to retrieve common control paths or data values– Profile information used in subsequent re-optimizing compilation step
Optimizing– Comprehensive collection of conventional optimizations
– control flow simplification, data flow analysis– Speculative and Java-specific optimizations
– e.g.. devirtualization, partial inlining, lock coarsening– Tuned code generation for latest x86, Power, zArchitecture and more
– e.g.. instruction selection, instruction scheduling, register allocation
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
POWER 6® and IBM System z10™ exploitation Inliner and basic block layout improvements
– Determine what’s hot, what’s not (common path analysis)
Lock reservation (IBM paper at OOPSLA ’02)– Improves scaling and overall performance
Dozens of platform dependent and independent optimizations implemented, (e.g., new register allocators, live range reduction, idiom recognition)
Just In Time (JIT) Compiler updatesJava Platform v.6
15
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
-Xgcpolicy:optthruput (default)– My applications is designed around raw throughput and some GC pause is acceptable. – There is little intermingling of garbage collection and application work – better raw throughput.– The application is stopped each time garbage is collected.– Start here for tuning.
-Xgcpolicy:gencon– My application allocates many short-lived objects.– The heap space is fragmented.– My application is transaction-based (that is, objects in the transaction don't survive beyond the
transaction commit).
-Xgcpolicy:optavgpause– My application cannot tolerate the length of the GC pauses. A degradation in performance is
acceptable as long as the GC pause time is reduced.– I am running on a 64-bit platform and use a very large heap -- more than 3 or 4GB.– My application is a GUI application and I'm concerned about the user response times.
-Xgcpolicy:subpool • I have scalability problems on large multiprocessor machines.
Garbage Collector (GC) modesJava Platform v.6
16
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Minor collection—takes place only in the young generation,normally done through direct copying => very efficient
Major collection—takes place in the new and old generation and 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<size>
Sun JVM Software Only:
• XX:MaxPermSize=nn
Nursery/Young Generation Old Generation Permanent Space
IBM J9:
• Xmo (-Xmos/-Xmox)
Sun:
• XX:NewRatio=n
Memory Management and Garbage Collection
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Significantly faster classLoader load/unload performance and improved footprint Hierarchical Scanning—faster, memory hierarchy aware optimization for—
Xgcpolicy: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 essentialfor server workloads
Garbage Collector (GC) updatesJava Platform v.6
18
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
0%
5%
10%
15%
20%
25%
30%
1 2 3 4 5 6 7 8 9 10 11 12 13 1415 16 1718 19 20 2122 2324 2526
Scanned Slot to Copied Object Distance(Log2)
Pro
po
rtio
n
Breadth-FirstHierarchical
64 bytecache line
page size (4 kB) – less TLB misses, less L2 cache misses
(SPECjbb2005)
Parent-Child Distances for Hierarchical
19
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
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 stats
Occupancy Constraint:30%* < free < 60%*
-Xminf < free < -Xmaxf
Duration Constraint:5%* < duration < 13%*
-Xmint < duration < -Xmaxt
Adjustment Size:1Mb* < adjustment < ∞*
-Xmine < adjustment < -Xmaxe
20
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Garbage collection -Xgcpolicy:gencon changes
Removed 64mb cap on default new space size. Default maximum value of –Xmns and –Xmnx is now 25% heap. ONLY applies if you specify –Xgcpolicy:gencon
Allocate Space Survivor Old Generation
-XmnsAllocate Space SurvivorOld Generation Reserved but unallocated
-Xmns
-Xmnx
Startup state
Maximal state
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Target: server environments where multiple JVM 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
OverviewJava Platform v.6—Shared Classes
22
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Shared Classes – details
Please attend Ben Corrie’s talk immediately following this one for many more details on what they are, how to use them, and when…
23
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Customer Feedback Resulting in Process Changes
Java platform v.5 and before => closed beta program Java platform v.6 => open early access program Move to iterative development model
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Agenda
History and ArchitectureJava Platform v.6—What’s New This Release?
Java 5 platform updates
Java 6 class library updates
JVM Software
Garbage Collection
JIT
Shared Classes
Serviceability Update
25
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Reliability, Availability, and Serviceability
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 regularly—looking for customer feedback
RAS strategy
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
IBM Support Assistant™
– Java platform 1.4.2, Java platform v.5, and Java platform v.6 plug-ins
Diagnostic Tool Framework For Java (DTFJ)– Presented at the 2006 JavaOneSM conference
DumpAnalyzer (using DTFJ)– First stop analysis engine for common Java problems (OutOfMemoryError and
crashes)
Garbage Collection and Memory Visualizer (GCMV)– Verbose GC visualization and analysis
Java Lock Analyzer (on alphaWorks)– Capture and visualize lock contention data.
Improvements across releasesReliability, Availability, and Serviceability
28
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
GCMV—Heap Usage Visualization
Heap occupancy
Pause times
29
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
GCMV—Comparison and Advice
Compare runs…
Performance advisor…
30
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
GCMV—Tuning Recommendations
31
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
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/earlyprograms/ibm/java6/
WebSphere® Real Time™
– http://www-306.ibm.com/software/webservers/realtime/
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
Agenda Review
History and ArchitectureJava Platform v.6—What’s New This Release?
Java 5 platform updates
Java 6 class library updates
JVM Software
Garbage Collection
JIT
Shared Classes
Serviceability Update
34
IBM Java Technology Centre
Java Overview | SE 6 Background and Update © 2008 IBM Corporation
© IBM Corporation 2008. All Rights Reserved.
The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising
out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.
References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the
amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer.
The following are trademarks of the International Business Machines Corporation in the United States and/or other countries. For a complete list of IBM trademarks, see www.ibm.com/legal/copytrade.shtmlAIX, CICS, CICSPlex, DB2, DB2 Universal Database, i5/OS, IBM, the IBM logo, IMS, iSeries, Lotus, OMEGAMON, OS/390, Parallel Sysplex, pureXML, Rational, RCAF, Redbooks, Sametime, Smart SOA, System i, System i5, System z , Tivoli, WebSphere, and z/OS. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.UNIX is a registered trademark of The Open Group in the United States and other countries.Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
Recommended