SlideShare a Scribd company logo
© 2011 IBM Corporation
WebSphere AI Summit
Inside IBM Java 7
Tim Ellison tim_ellison@uk.ibm.com
Senior technical Staff Member
Java Technology Centre, UK. twitter: @tpellison
© 2011 IBM Corporation
Important Disclaimers
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES
ONLY.
WHILST 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.
ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED
ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR
INFRASTRUCTURE DIFFERENCES.
ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT
PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF
THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
- CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR
THEIR SUPPLIERS AND/OR LICENSORS
© 2011 IBM Corporation
Agenda – Inside IBM Java 7
 High level goals for Java 7
 Base feature details
– JSR 334 – Small language enhancements (Project Coin)
– JSR 203 – More new I/O APIs for the Java platform (NIO.2)
– JSR 292 – invokedynamic
– JSR 166y – concurrency and collections updates
 Smaller features (TLS 1.2, UNICODE 6.0...)
 IBM feature details
– Performance & platform exploitation – z196, POWER 7, ...
– Garbage Collector updates & new policy - “balanced”
– Technology Evaluation: WebSphere Real Time
– Serviceability improvements & Tools overview
 Questions?
© 2011 IBM Corporation
High level goals for Java 7
 Major Java platform release, touching on all aspects of the language and JVM
The goals for Java 7 SE are:
– Compatibility - “Any program running on a previous release of the platform
must also run unchanged on an implementation of Java SE 7”
– Productivity - “...promote best coding practices and reduce boilerplate...
minimal learning curve...”
– Performance - “...new concurrency APIs... enable I/O-intensive applications by
introducing a true asynchronous I/O API..”
– Universality - “...accelerate the performance of dynamic languages on the
Java Virtual Machine.”
– Integration - “Java SE 7 will include a new, flexible filesystem API as part of
JSR 203...”
© 2011 IBM Corporation
New Language Constructs – project “coin”
 It's a “bunch of small change(s)”
 Strings in switch
switch(myString) {
case “one”: <do something>; break;
case “red”: <do something else>; break;
default: <do something generic>;
}
 Improved Type Inference for Generic Instance Creation (diamond)
Map<String,MyType> foo = new Map<String,MyType>();
Becomes
Map<String,MyType> foo = new Map<>();
© 2011 IBM Corporation
Coin continued...
 An omnibus proposal for better integral literals
– Allow binary literals (0b10011010)
– Allow underscores in numbers to help visual blocking (34_409_066)
– Unsigned literals (0xDEu)
 Simplified Varargs Method Invocation
– Moves warnings to method declaration, rather than on each user. Reduces unavoidable
warnings.
© 2011 IBM Corporation
Coin – multi-catch
 Developers often want to catch 2 exceptions the same way, but can't in Java 6:
try {
} catch(Exception a) {
problemHandler(a);
} catch(Error b) {
problemHandler(b);
}
 The following now works
try {
} catch(Exception|Error a) {
problemHandler(a);
}
© 2011 IBM Corporation
Coin – Automatic Resource Management
 Dealing with all possible failure paths is hard.
 Closing resources correctly in failure cases is hard.
 Idea: get the compiler to help, and define an interface on resources that knows how to tidy
up automatically.
try(InputStream inFile = new FileInputStream(aFileName);
OutputStream outFile = new FileOutputStream(aFileName)) {
byte[] buf = new byte[BUF_SIZE];
int readBytes;
while ((readBytes = inFile.read(buf)) >= 0)
inFile.write(buf, readBytes);
}
© 2011 IBM Corporation
NIO.2 – More new I/O APIs for Java (JSR 203)
 Goal: enable Java programmers to unlock the more powerful I/O abstractions.
 Asynchronous I/O
– Delegated IO operations
– Enable significant control over how I/O operations are handled, enabling better scaling.
– Socket & file classes available.
– 2 approaches to completion notification
• java.util.concurrent.Future
• CompletionHandler interface (competed() & failed() calls).
– Flexible thread pooling strategies, including custom ones.
© 2011 IBM Corporation
NIO.2 – New filesystem API
 Address long-standing usability issues & boilerplate
– User-level modelling of more file system concepts like symlinks
– File attributes modelled to represent FS-specific attributes (eg: owner, permissions...)
– DirectoryStream iterates through directories
• Scales very well, using less resources.
• Allows glob, regex or custom filtering.
– Recursive walks now provided, modelled on Visitor pattern.
 Model entirely artificial file systems much like Windows Explorer extensions
 File Change Notification
– Improves performance of apps that currently poll to observe changes.
© 2011 IBM Corporation
Directory Visitor - example
Files.walkFileTree(myPath, new SimpleFileVisitor<Path>() {
public FileVisitResult visitFile(Path file,
BasicFileAttributes attrs) {
try {
file.doWhatIWanted();
} catch (IOException exc) {
// do error handling
}
return FileVisitResult.CONTINUE;
}
}
);
© 2011 IBM Corporation
java.util.concurrent updates
 As multicore becomes more prevalent, data structures and algorithms to match are key.
 Major new abstraction: Fork/Join framework
– Very good at 'divide and conquer' problems
– Specific model for parallel computation acceleration, significantly more efficient than
normal Thread or Executor -base synchronization models.
– Implements work stealing for lopsided work breakdowns
 Other enhancements
– TransferQueue – model producer/consumer queues efficiently
– Phaser – very flexible synchronization barrier
© 2011 IBM Corporation
JSR 292 - invokedynamic
 The JVM managed runtime is becoming home to more languages (eg: jruby, jython, fan,
clojure, etc..) but is missing some of the fundamentals that help make those languages
go fast.
 JSR 292 decouples method lookup and method dispatch
– Get away from being purely Java (the language) centric.
 Approach: introduce a new bytecode that executes a given method directly, and
provides the ability at runtime to rewire what method that is.
– Include a model for building up mutators (add a parameter, drop a parameter, etc..)
– Ensure the JIT can efficiently exploit these constructs to ensure efficient code
generation.
© 2011 IBM Corporation
Smaller Items
 Classloader changes
– Enable parallel classloading capability via new “safe” API.
– URLClassLoader gains a close() method.
 I18N - Unicode 6.0, Locale enhancement, Separate user locale and user-
interface locale
 TLS 1.2 – Security updates.
 JDBC 4.1 – ARM awareness.
 Client (UI) updates
– Create new platform APIs for 6u10 graphics features
– Nimbus look-and-feel for Swing
– Swing JLayer component
– XRender support
 Update the XML stack
© 2011 IBM Corporation
IBM-Unique Updates and Improvements
© 2011 IBM Corporation
Performance
 “4 out of 5 publishes prefer J9”
– http://www.spec.org/jbb2005/results/res2010q4/
– 88% of SPECjbb2005 publishes in last year with J9
• 94 with J9, 9 with HotSpot, 5 with Jrockit
 POWER7 Exploitation
– New prefetching capabilities
– Extended divide instructions
– Conversion between integer and float
– Bit permutation and popcount instructions
– BCD assist - Exploited through Java BigDecimal
 System zEnterprise 196 Exploitation
– 70+ new instructions
• High-word facility
• Interlock-update facility
• Non-destructive operands
• Conditional load/store
– 93% Aggregate improvement
• 14% Java 6.0.1 improvement
• 70% Hardware improvement
z/OS CPU Intensive Java
Workload
0
50
100
150
z10 J6 SR9
z196 J6 R2.6
z196 J6 SR9
© 2011 IBM Corporation
GC policies since IBM Java 5
Time
Thread 1
Thread 2
Thread 3
Thread n
GC
Java
-Xgcpolicy:optthruput (and –Xgcpolicy:subpool)
Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is
to show theoretical differences in pause times between GC policies.
How do the policies compare?
17
© 2011 IBM Corporation
GC policies since IBM Java 5
Time
GC
Java
Concurrent Tracing
-Xgcpolicy:optavgpause
Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is
to show theoretical differences in pause times between GC policies.
Thread 1
Thread 2
Thread 3
Thread n
How do the policies compare?
18
© 2011 IBM Corporation
GC policies since IBM Java 5
Time
Global GC
Java
Concurrent Tracing
Scavenge GC
-Xgcpolicy:gencon
Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is
to show theoretical differences in pause times between GC policies.
Thread 1
Thread 2
Thread 3
Thread n
How do the policies compare?
DEFAULT
in Java 7
19
© 2011 IBM Corporation
Next-Gen Hardware and Software Challenges
 Meet customer needs for scaling
garbage collection technology on
large heaps
 Provide strong adaptive performance without expert advice
– Flexible and adaptive behavior to provide a good first impression
– Every tuning option increases complexity by an order of magnitude
Heap Size
PauseTime
curre
nt
desired
Time
PauseTime
curre
nt
desired
 Maintain and increase technological competitive edge through innovation
– Address new developments in industry quickly
 Showcase hardware capabilities
through exploitation of platform
facilities
© 2011 IBM Corporation
-Xgcpolicy:balanced
 Incrementally collect areas of the heap that meet our needs – Partial Garbage Collect (PGC)
– Reduced pause times
– Freeing up memory
 Heap “collection set” selection based on best ROI (free memory) factors
– E.g., Recently allocated objects, areas that reduce fragmentation
 Various technologies applied
– Copy Forward (default)
• High level of object mobility (similar to gencon GC policy)
– Mark / Sweep / Compact
• Separates the notion of “collection” vs. “compaction”
Heap
Newly Allocated Newly AllocatedFragmented
Heap areas selected for GC
“Collection Set”
© 2011 IBM Corporation
Specifics
 Suggested deployment scenario(s)
– Larger (>4GB) heaps.
– Frequent global garbage collections.
– Excessive time spent in global compaction.
– Relatively frequent allocation of large (>1MB) arrays.
 Fully supported on all IBM Java 7 64 bit platforms
– First class citizen with other existing GC policies.
 We encourage use of the policy and welcome feedback!
– The opportunity exists to work with the dev team.
© 2011 IBM Corporation
Garbage Collection changes and improvements
 -Xgcpolicy:gencon is now the default
– Provides a better out of the box performance for a most applications
– Easily switch back to the old default with -Xgcpolicy:optthruput
 Object header size reduction & compressed references
– Object headers are 4-16 bytes depending on object type and object reference size (32bit,
64bit compressed reference or 64bit)
– “small 64 bit” (eg: 4-20GB) now have a 32-bit like footprint (new in a Java 6 SR).
– Reduces garbage collection frequency
– Provides better object locality
 Scalability improvements to all garbage collection policies on large n-way machines
(#CPU > 64)
– Decreases the time spent in garbage collections pauses
 Scalability improvements to allocation mechanism for highly parallel applications
– -Xgcpolicy:subpool is now an alias for -Xgcpolicy:optthruput
 New format for verbose:gc output
– Event based instead of summary based
– Provides more detailed information for easier analysis
© 2011 IBM Corporation
Try Out WebSphere Real Time (WRT)
 WebSphere Real Time is a Java Runtime built with J9 technology that provides
consistent performance
– Incremental GC means consistently short (3ms) GC pause times
– JIT compilations cannot block application threads
– Also a Hard Real Time flavor that runs on Real-Time Linux (e.g. RHEL MRG, Novell
SLERT)
 IBM Java 7 will include evaluation version of upcoming WRT-V3
– New pause time target option lets you configure GC pause times
– Throughput performance improvements
– 32- and 64-bit Linux on x86, 32- and 64-bit AIX on POWER
 Just add -Xgcpolicy:metronome to your Java 7 command line to try it out!
© 2011 IBM Corporation
GC Pause Times: gencon and metronome
~5ms ~8ms
10ms – 14 ms
70ms
Gencon pause times
2.8ms - 3.2ms
Metronome Pause Times (Target=3ms)
Metronome Pause Times (Target=6ms)
Metronome Pause Times (Target=10ms)
5.8ms - 6.2ms
9.8ms - 10.2ms
 Most GC policies have pause times
ranging upwards of 10 – 100 ms
 Metronome controls pause times to
as short as 3ms
 Throughput impact, varies by
application
© 2011 IBM Corporation
Consumability and RAS Enhancements
 -Xdump
– Native stack traces in javacore
– Environment variables and ULIMITs in javacore
– Native memory usage counters in javacore and from core dumps via DTFJ
– Multi-part TDUMPs on zOS 64
 -Xtrace
– Tracepoints can include Java stacks (jstacktrace)
 -Xlog
– Messages go to the Event log on Windows, syslog on Linux, errlog or syslog on AIX,
MVS console on zOS.
© 2011 IBM Corporation
Native memory usage counters
NATIVEMEMINFO subcomponent dump routine
=======================================
JRE: 555,698,264 bytes / 1208 allocations
|
+--VM: 552,977,664 bytes / 856 allocations
| |
| +--Classes: 1,949,664 bytes / 92 allocations
| |
| +--Memory Manager (GC): 547,705,848 bytes / 146 allocations
| | |
| | +--Java Heap: 536,875,008 bytes / 1 allocation
| | |
| | +--Other: 10,830,840 bytes / 145 allocations
| |
| +--Threads: 2,660,804 bytes / 104 allocations
| | |
| | +--Java Stack: 64,944 bytes / 9 allocations
| | |
| | +--Native Stack: 2,523,136 bytes / 11 allocations
| | |
| | +--Other: 72,724 bytes / 84 allocations
| |
| +--Trace: 92,464 bytes / 208 allocations
| |
© 2011 IBM Corporation
Example JVM message in Windows Event log
© 2011 IBM Corporation
Garbage Collection and Memory Visualizer (GCMV)
 Tool to analyze Java verbose GC logs
 Graphs Recommendations use heuristics to guide
you towards issues that may be limiting
performance.
 Show garbage collection and Java heap statistics
over time.
 Not only for memory errors, very good for
performance tuning.
Diagnostics Collector
 At JVM start it runs a diagnostic configuration check
 Runs as a separate process when the JVM detects a ‘dump event’
–
GPF
–
Java heap OutOfMemoryError
–
Unexpected signal received
–
(optionally) JVM start, JVM stop
 Knows all possible dump locations and searches to gather all dumps into a single zip file
 Collects system dumps, Java dumps, heap dumps, verbose GC logs
 If system dump found jextract runs automatically
 Requires IBM SDK for Java version 5.0 or above
29
© 2011 IBM Corporation
Memory Analyzer
 Eclipse project for analyzing heap dumps and
identifying memory leaks from JVMs
 Works with IBM system dumps, heapdumps and Sun
HPROF binary dumps
 Provides memory leak detection and footprint
analysis

Objects by Class, Dominator Tree Analysis, Path
to GC Roots, Dominator Tree by Class Loader
 Provides SQL like object query language (OQL)
 Provides extension points to write analysis plugins
Health Center
 Live monitoring tool with very low overhead
 Understand how your application is behaving
 It provides access to information about method
profiling, garbage collection, class loading, locking
and environment data
 Diagnose potential problems, with
recommendations
 Works at the JVM level – no domain-specific (e.g.
J2EE) information
 Suitable for all Java applications30
© 2011 IBM Corporation
Summary & Conclusion
 Base Java 7 Features
– NIO.2, java.util.concurrent, etc...
 IBM feature details
– Performance & Platform Exploitation
– Garbage Collection Updates & “Balanced” GC policy
– Serviceability improvements
 Free Tools Overview
© 2011 IBM Corporation
© IBM Corporation 2011. All Rights Reserved.
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of
International Business Machines Corp., registered in many jurisdictions
worldwide. Other product and service names might be trademarks of IBM or
other companies. A current list of IBM trademarks is available on the Web at
“Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml.
Copyright and Trademarks

More Related Content

PDF
Java on zSystems zOS
PDF
What's New in IBM Java 8 SE?
PPTX
Migrating Legacy Code
PDF
Virtualization aware Java VM
PDF
A Java Implementer's Guide to Better Apache Spark Performance
PDF
JavaOne2013: Implement a High Level Parallel API - Richard Ning
PPT
Was l iberty for java batch and jsr352
PPTX
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
Java on zSystems zOS
What's New in IBM Java 8 SE?
Migrating Legacy Code
Virtualization aware Java VM
A Java Implementer's Guide to Better Apache Spark Performance
JavaOne2013: Implement a High Level Parallel API - Richard Ning
Was l iberty for java batch and jsr352
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6

What's hot (20)

PDF
Three key concepts for java batch
PDF
Java one 2015 [con3339]
PDF
JavaOne BOF 5957 Lightning Fast Access to Big Data
PPT
Classloader leak detection in websphere application server
PDF
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
PDF
WebSphere Technical University: Top WebSphere Problem Determination Features
PDF
Обзор современных возможностей по распараллеливанию и векторизации приложений...
PPTX
SemeruRuntimesUnderTheCover .pptx
PPTX
S109 cics-java
PPT
Designing JEE Application Structure
PDF
GlassFish 3.1 at JCertif 2011
PDF
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
PPTX
WAS Support & Monitoring Tools
PDF
VMIL keynote : Lessons from a production JVM runtime developer
PDF
WebSphere Application Server JBoss TCO analysis
PDF
Java EE 7 at JAX London 2011 and JFall 2011
PDF
JavaOne2013: Secure Engineering Practices for Java
PDF
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
PPT
Introduction to java_ee
PDF
JavaFX - Bringing rich Internet applications ...
Three key concepts for java batch
Java one 2015 [con3339]
JavaOne BOF 5957 Lightning Fast Access to Big Data
Classloader leak detection in websphere application server
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
WebSphere Technical University: Top WebSphere Problem Determination Features
Обзор современных возможностей по распараллеливанию и векторизации приложений...
SemeruRuntimesUnderTheCover .pptx
S109 cics-java
Designing JEE Application Structure
GlassFish 3.1 at JCertif 2011
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WAS Support & Monitoring Tools
VMIL keynote : Lessons from a production JVM runtime developer
WebSphere Application Server JBoss TCO analysis
Java EE 7 at JAX London 2011 and JFall 2011
JavaOne2013: Secure Engineering Practices for Java
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
Introduction to java_ee
JavaFX - Bringing rich Internet applications ...
Ad

Similar to Inside IBM Java 7 (20)

PDF
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
PPT
Java on z overview 20161107
PDF
Travelling Light for the Long Haul - Ian Robinson
PDF
Travelling light for the long haul
PPT
Java8 - Under the hood
PDF
Real World Java Compatibility
PPTX
Java By Sai NagaVenkata BuchiBabu Manepalli
PPTX
Java By Sai NagaVenkata BuchiBabu Manepalli
PDF
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
PDF
Whats new in Enterprise 5.0 Product Suite
PDF
Understand the Trade-offs Using Compilers for Java Applications
PPT
Sunstate
PDF
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
PDF
Serverless Java - Challenges and Triumphs
PDF
Lec2 ecom fall16
DOCX
Project report for final year project
PPT
SunMicroSystems
PDF
Java 25 and Beyond - A Roadmap of Innovations
PDF
UI5con 2018: UI5 Evolution - The Core Changes
PPTX
Advance java prasentation
Three Key Concepts for Understanding JSR-352: Batch Programming for the Java ...
Java on z overview 20161107
Travelling Light for the Long Haul - Ian Robinson
Travelling light for the long haul
Java8 - Under the hood
Real World Java Compatibility
Java By Sai NagaVenkata BuchiBabu Manepalli
Java By Sai NagaVenkata BuchiBabu Manepalli
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
Whats new in Enterprise 5.0 Product Suite
Understand the Trade-offs Using Compilers for Java Applications
Sunstate
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
Serverless Java - Challenges and Triumphs
Lec2 ecom fall16
Project report for final year project
SunMicroSystems
Java 25 and Beyond - A Roadmap of Innovations
UI5con 2018: UI5 Evolution - The Core Changes
Advance java prasentation
Ad

More from Tim Ellison (8)

PDF
The Extraordinary World of Quantum Computing
PDF
Apache Big Data Europe 2016
PPT
Apache Harmony: An Open Innovation
PDF
Secure Engineering Practices for Java
PDF
Securing Java in the Server Room
PDF
Modules all the way down: OSGi and the Java Platform Module System
PDF
Five cool ways the JVM can run Apache Spark faster
PDF
Using GPUs to Handle Big Data with Java
The Extraordinary World of Quantum Computing
Apache Big Data Europe 2016
Apache Harmony: An Open Innovation
Secure Engineering Practices for Java
Securing Java in the Server Room
Modules all the way down: OSGi and the Java Platform Module System
Five cool ways the JVM can run Apache Spark faster
Using GPUs to Handle Big Data with Java

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
August Patch Tuesday
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Empathic Computing: Creating Shared Understanding
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Univ-Connecticut-ChatGPT-Presentaion.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
cloud_computing_Infrastucture_as_cloud_p
August Patch Tuesday
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Empathic Computing: Creating Shared Understanding
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Programs and apps: productivity, graphics, security and other tools
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx

Inside IBM Java 7

  • 1. © 2011 IBM Corporation WebSphere AI Summit Inside IBM Java 7 Tim Ellison [email protected] Senior technical Staff Member Java Technology Centre, UK. twitter: @tpellison
  • 2. © 2011 IBM Corporation Important Disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILST 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. ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES. ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: - CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS
  • 3. © 2011 IBM Corporation Agenda – Inside IBM Java 7  High level goals for Java 7  Base feature details – JSR 334 – Small language enhancements (Project Coin) – JSR 203 – More new I/O APIs for the Java platform (NIO.2) – JSR 292 – invokedynamic – JSR 166y – concurrency and collections updates  Smaller features (TLS 1.2, UNICODE 6.0...)  IBM feature details – Performance & platform exploitation – z196, POWER 7, ... – Garbage Collector updates & new policy - “balanced” – Technology Evaluation: WebSphere Real Time – Serviceability improvements & Tools overview  Questions?
  • 4. © 2011 IBM Corporation High level goals for Java 7  Major Java platform release, touching on all aspects of the language and JVM The goals for Java 7 SE are: – Compatibility - “Any program running on a previous release of the platform must also run unchanged on an implementation of Java SE 7” – Productivity - “...promote best coding practices and reduce boilerplate... minimal learning curve...” – Performance - “...new concurrency APIs... enable I/O-intensive applications by introducing a true asynchronous I/O API..” – Universality - “...accelerate the performance of dynamic languages on the Java Virtual Machine.” – Integration - “Java SE 7 will include a new, flexible filesystem API as part of JSR 203...”
  • 5. © 2011 IBM Corporation New Language Constructs – project “coin”  It's a “bunch of small change(s)”  Strings in switch switch(myString) { case “one”: <do something>; break; case “red”: <do something else>; break; default: <do something generic>; }  Improved Type Inference for Generic Instance Creation (diamond) Map<String,MyType> foo = new Map<String,MyType>(); Becomes Map<String,MyType> foo = new Map<>();
  • 6. © 2011 IBM Corporation Coin continued...  An omnibus proposal for better integral literals – Allow binary literals (0b10011010) – Allow underscores in numbers to help visual blocking (34_409_066) – Unsigned literals (0xDEu)  Simplified Varargs Method Invocation – Moves warnings to method declaration, rather than on each user. Reduces unavoidable warnings.
  • 7. © 2011 IBM Corporation Coin – multi-catch  Developers often want to catch 2 exceptions the same way, but can't in Java 6: try { } catch(Exception a) { problemHandler(a); } catch(Error b) { problemHandler(b); }  The following now works try { } catch(Exception|Error a) { problemHandler(a); }
  • 8. © 2011 IBM Corporation Coin – Automatic Resource Management  Dealing with all possible failure paths is hard.  Closing resources correctly in failure cases is hard.  Idea: get the compiler to help, and define an interface on resources that knows how to tidy up automatically. try(InputStream inFile = new FileInputStream(aFileName); OutputStream outFile = new FileOutputStream(aFileName)) { byte[] buf = new byte[BUF_SIZE]; int readBytes; while ((readBytes = inFile.read(buf)) >= 0) inFile.write(buf, readBytes); }
  • 9. © 2011 IBM Corporation NIO.2 – More new I/O APIs for Java (JSR 203)  Goal: enable Java programmers to unlock the more powerful I/O abstractions.  Asynchronous I/O – Delegated IO operations – Enable significant control over how I/O operations are handled, enabling better scaling. – Socket & file classes available. – 2 approaches to completion notification • java.util.concurrent.Future • CompletionHandler interface (competed() & failed() calls). – Flexible thread pooling strategies, including custom ones.
  • 10. © 2011 IBM Corporation NIO.2 – New filesystem API  Address long-standing usability issues & boilerplate – User-level modelling of more file system concepts like symlinks – File attributes modelled to represent FS-specific attributes (eg: owner, permissions...) – DirectoryStream iterates through directories • Scales very well, using less resources. • Allows glob, regex or custom filtering. – Recursive walks now provided, modelled on Visitor pattern.  Model entirely artificial file systems much like Windows Explorer extensions  File Change Notification – Improves performance of apps that currently poll to observe changes.
  • 11. © 2011 IBM Corporation Directory Visitor - example Files.walkFileTree(myPath, new SimpleFileVisitor<Path>() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { try { file.doWhatIWanted(); } catch (IOException exc) { // do error handling } return FileVisitResult.CONTINUE; } } );
  • 12. © 2011 IBM Corporation java.util.concurrent updates  As multicore becomes more prevalent, data structures and algorithms to match are key.  Major new abstraction: Fork/Join framework – Very good at 'divide and conquer' problems – Specific model for parallel computation acceleration, significantly more efficient than normal Thread or Executor -base synchronization models. – Implements work stealing for lopsided work breakdowns  Other enhancements – TransferQueue – model producer/consumer queues efficiently – Phaser – very flexible synchronization barrier
  • 13. © 2011 IBM Corporation JSR 292 - invokedynamic  The JVM managed runtime is becoming home to more languages (eg: jruby, jython, fan, clojure, etc..) but is missing some of the fundamentals that help make those languages go fast.  JSR 292 decouples method lookup and method dispatch – Get away from being purely Java (the language) centric.  Approach: introduce a new bytecode that executes a given method directly, and provides the ability at runtime to rewire what method that is. – Include a model for building up mutators (add a parameter, drop a parameter, etc..) – Ensure the JIT can efficiently exploit these constructs to ensure efficient code generation.
  • 14. © 2011 IBM Corporation Smaller Items  Classloader changes – Enable parallel classloading capability via new “safe” API. – URLClassLoader gains a close() method.  I18N - Unicode 6.0, Locale enhancement, Separate user locale and user- interface locale  TLS 1.2 – Security updates.  JDBC 4.1 – ARM awareness.  Client (UI) updates – Create new platform APIs for 6u10 graphics features – Nimbus look-and-feel for Swing – Swing JLayer component – XRender support  Update the XML stack
  • 15. © 2011 IBM Corporation IBM-Unique Updates and Improvements
  • 16. © 2011 IBM Corporation Performance  “4 out of 5 publishes prefer J9” – http://www.spec.org/jbb2005/results/res2010q4/ – 88% of SPECjbb2005 publishes in last year with J9 • 94 with J9, 9 with HotSpot, 5 with Jrockit  POWER7 Exploitation – New prefetching capabilities – Extended divide instructions – Conversion between integer and float – Bit permutation and popcount instructions – BCD assist - Exploited through Java BigDecimal  System zEnterprise 196 Exploitation – 70+ new instructions • High-word facility • Interlock-update facility • Non-destructive operands • Conditional load/store – 93% Aggregate improvement • 14% Java 6.0.1 improvement • 70% Hardware improvement z/OS CPU Intensive Java Workload 0 50 100 150 z10 J6 SR9 z196 J6 R2.6 z196 J6 SR9
  • 17. © 2011 IBM Corporation GC policies since IBM Java 5 Time Thread 1 Thread 2 Thread 3 Thread n GC Java -Xgcpolicy:optthruput (and –Xgcpolicy:subpool) Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is to show theoretical differences in pause times between GC policies. How do the policies compare? 17
  • 18. © 2011 IBM Corporation GC policies since IBM Java 5 Time GC Java Concurrent Tracing -Xgcpolicy:optavgpause Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is to show theoretical differences in pause times between GC policies. Thread 1 Thread 2 Thread 3 Thread n How do the policies compare? 18
  • 19. © 2011 IBM Corporation GC policies since IBM Java 5 Time Global GC Java Concurrent Tracing Scavenge GC -Xgcpolicy:gencon Picture is only illustrative and doesn’t reflect any particular real-life application. The purpose is to show theoretical differences in pause times between GC policies. Thread 1 Thread 2 Thread 3 Thread n How do the policies compare? DEFAULT in Java 7 19
  • 20. © 2011 IBM Corporation Next-Gen Hardware and Software Challenges  Meet customer needs for scaling garbage collection technology on large heaps  Provide strong adaptive performance without expert advice – Flexible and adaptive behavior to provide a good first impression – Every tuning option increases complexity by an order of magnitude Heap Size PauseTime curre nt desired Time PauseTime curre nt desired  Maintain and increase technological competitive edge through innovation – Address new developments in industry quickly  Showcase hardware capabilities through exploitation of platform facilities
  • 21. © 2011 IBM Corporation -Xgcpolicy:balanced  Incrementally collect areas of the heap that meet our needs – Partial Garbage Collect (PGC) – Reduced pause times – Freeing up memory  Heap “collection set” selection based on best ROI (free memory) factors – E.g., Recently allocated objects, areas that reduce fragmentation  Various technologies applied – Copy Forward (default) • High level of object mobility (similar to gencon GC policy) – Mark / Sweep / Compact • Separates the notion of “collection” vs. “compaction” Heap Newly Allocated Newly AllocatedFragmented Heap areas selected for GC “Collection Set”
  • 22. © 2011 IBM Corporation Specifics  Suggested deployment scenario(s) – Larger (>4GB) heaps. – Frequent global garbage collections. – Excessive time spent in global compaction. – Relatively frequent allocation of large (>1MB) arrays.  Fully supported on all IBM Java 7 64 bit platforms – First class citizen with other existing GC policies.  We encourage use of the policy and welcome feedback! – The opportunity exists to work with the dev team.
  • 23. © 2011 IBM Corporation Garbage Collection changes and improvements  -Xgcpolicy:gencon is now the default – Provides a better out of the box performance for a most applications – Easily switch back to the old default with -Xgcpolicy:optthruput  Object header size reduction & compressed references – Object headers are 4-16 bytes depending on object type and object reference size (32bit, 64bit compressed reference or 64bit) – “small 64 bit” (eg: 4-20GB) now have a 32-bit like footprint (new in a Java 6 SR). – Reduces garbage collection frequency – Provides better object locality  Scalability improvements to all garbage collection policies on large n-way machines (#CPU > 64) – Decreases the time spent in garbage collections pauses  Scalability improvements to allocation mechanism for highly parallel applications – -Xgcpolicy:subpool is now an alias for -Xgcpolicy:optthruput  New format for verbose:gc output – Event based instead of summary based – Provides more detailed information for easier analysis
  • 24. © 2011 IBM Corporation Try Out WebSphere Real Time (WRT)  WebSphere Real Time is a Java Runtime built with J9 technology that provides consistent performance – Incremental GC means consistently short (3ms) GC pause times – JIT compilations cannot block application threads – Also a Hard Real Time flavor that runs on Real-Time Linux (e.g. RHEL MRG, Novell SLERT)  IBM Java 7 will include evaluation version of upcoming WRT-V3 – New pause time target option lets you configure GC pause times – Throughput performance improvements – 32- and 64-bit Linux on x86, 32- and 64-bit AIX on POWER  Just add -Xgcpolicy:metronome to your Java 7 command line to try it out!
  • 25. © 2011 IBM Corporation GC Pause Times: gencon and metronome ~5ms ~8ms 10ms – 14 ms 70ms Gencon pause times 2.8ms - 3.2ms Metronome Pause Times (Target=3ms) Metronome Pause Times (Target=6ms) Metronome Pause Times (Target=10ms) 5.8ms - 6.2ms 9.8ms - 10.2ms  Most GC policies have pause times ranging upwards of 10 – 100 ms  Metronome controls pause times to as short as 3ms  Throughput impact, varies by application
  • 26. © 2011 IBM Corporation Consumability and RAS Enhancements  -Xdump – Native stack traces in javacore – Environment variables and ULIMITs in javacore – Native memory usage counters in javacore and from core dumps via DTFJ – Multi-part TDUMPs on zOS 64  -Xtrace – Tracepoints can include Java stacks (jstacktrace)  -Xlog – Messages go to the Event log on Windows, syslog on Linux, errlog or syslog on AIX, MVS console on zOS.
  • 27. © 2011 IBM Corporation Native memory usage counters NATIVEMEMINFO subcomponent dump routine ======================================= JRE: 555,698,264 bytes / 1208 allocations | +--VM: 552,977,664 bytes / 856 allocations | | | +--Classes: 1,949,664 bytes / 92 allocations | | | +--Memory Manager (GC): 547,705,848 bytes / 146 allocations | | | | | +--Java Heap: 536,875,008 bytes / 1 allocation | | | | | +--Other: 10,830,840 bytes / 145 allocations | | | +--Threads: 2,660,804 bytes / 104 allocations | | | | | +--Java Stack: 64,944 bytes / 9 allocations | | | | | +--Native Stack: 2,523,136 bytes / 11 allocations | | | | | +--Other: 72,724 bytes / 84 allocations | | | +--Trace: 92,464 bytes / 208 allocations | |
  • 28. © 2011 IBM Corporation Example JVM message in Windows Event log
  • 29. © 2011 IBM Corporation Garbage Collection and Memory Visualizer (GCMV)  Tool to analyze Java verbose GC logs  Graphs Recommendations use heuristics to guide you towards issues that may be limiting performance.  Show garbage collection and Java heap statistics over time.  Not only for memory errors, very good for performance tuning. Diagnostics Collector  At JVM start it runs a diagnostic configuration check  Runs as a separate process when the JVM detects a ‘dump event’ – GPF – Java heap OutOfMemoryError – Unexpected signal received – (optionally) JVM start, JVM stop  Knows all possible dump locations and searches to gather all dumps into a single zip file  Collects system dumps, Java dumps, heap dumps, verbose GC logs  If system dump found jextract runs automatically  Requires IBM SDK for Java version 5.0 or above 29
  • 30. © 2011 IBM Corporation Memory Analyzer  Eclipse project for analyzing heap dumps and identifying memory leaks from JVMs  Works with IBM system dumps, heapdumps and Sun HPROF binary dumps  Provides memory leak detection and footprint analysis  Objects by Class, Dominator Tree Analysis, Path to GC Roots, Dominator Tree by Class Loader  Provides SQL like object query language (OQL)  Provides extension points to write analysis plugins Health Center  Live monitoring tool with very low overhead  Understand how your application is behaving  It provides access to information about method profiling, garbage collection, class loading, locking and environment data  Diagnose potential problems, with recommendations  Works at the JVM level – no domain-specific (e.g. J2EE) information  Suitable for all Java applications30
  • 31. © 2011 IBM Corporation Summary & Conclusion  Base Java 7 Features – NIO.2, java.util.concurrent, etc...  IBM feature details – Performance & Platform Exploitation – Garbage Collection Updates & “Balanced” GC policy – Serviceability improvements  Free Tools Overview
  • 32. © 2011 IBM Corporation © IBM Corporation 2011. All Rights Reserved. IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml. Copyright and Trademarks