Java Performance on z/OS: A Report From the Front Lines CMG2005 Craig Hodgins Paper 5047 Session 332.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
® IBM Software Group © 2010 IBM Corporation What’s New in Profiling & Code Coverage RAD V8 April 21, 2011 Kathy Chan
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Lab#1 (14/3/1431h) Introduction To java programming cs425
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
For more Lectures and Notes Visit
1 Chapter 3 Programs and Packages. 2 Java Virtual Machine (JVM) Java programs execute on the JVM. The JVM is a virtual rather than a physical machine,
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Understanding and Managing WebSphere V5
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1 Testing Concurrent Programs Why Test?  Eliminate bugs?  Software Engineering vs Computer Science perspectives What properties are we testing for? 
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Introduction Optimizing Application Performance with Pinpoint Accuracy What every IT Executive, Administrator & Developer Needs to Know.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
J2EE Structure & Definitions Catie Welsh CSE 432
Lecture 10 : Introduction to Java Virtual Machine
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Lecture :2 1.  DEFENTION : Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Application Architecture Using Java Hong Li. Introduction Developed by a team led by James Gosling at Sun Microsystem. Originally called Oak, designed.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Java – in context Main Features From Sun Microsystems ‘White Paper’
Duke CPS Java: make it run, make it right, make it fast (see Byte, May 1998, for more details) l “Java isn’t fast enough for ‘real’ applications”
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Programming Session 6 LBSC 690 Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Introduction to JAVA Programming
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Key Ideas from day 1 slides
Java programming lecture one
Introduction Enosis Learning.
Introduction Enosis Learning.
Java History, Editions, Version Features
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Enterprise Java Beans.
Plug-In Architecture Pattern
Just In Time Compilation
Presentation transcript:

Java Performance on z/OS: A Report From the Front Lines CMG2005 Craig Hodgins Paper 5047 Session 332

CMG2005 A Brief History of Java Why Java Matters on the Mainframe An Overview of Java for Mainframers Review of Two STROBE Measurements JVM CPU JITC CPU JAVAJIT CPU ZIP files Java CPU Overhead (logging, security) Java Methods Summary Agenda

CMG2005 A Brief History of Java 10 years old Developed at Sun Microsystems as an embedded language for household appliances Redesigned to work with cable TV Language of choice for the Internet Still used as an embedded language

CMG2005 Why Java Matters on the Mainframe IBM developed WebSphere Application Server Enables organizations to utilize Java applications under z/OS Java is frequently the biggest consumer of CPU in a WAS environment Java is replacing COBOL as the language of choice But Java consumes 5 to 10 times more CPU than COBOL does for the same function

CMG2005 What is Java? Java is not… … a 1960’s reference to coffee … an island in the Pacific

CMG2005 What is Java? An object-oriented language Objects (bank account) Methods (withdrawal, deposit, open, close)

CMG2005 Components of Java Applets are Java programs running in a web browser Servlets are Java programs running in a web server JavaServer Pages (JSPs) display data to the user Enterprise Java Beans (EJBs) are server- side components that contain business logic Most of these components can execute under WAS on z/OS

CMG2005 Java / COBOL Java method contains multiple statements and is like a COBOL CSECT Java class contains multiple methods and is like a COBOL load module A Java package is an organizational tool similar to a high level qualifier or a Windows directory A Java CLASSPATH is similar to a library in z/OS or a PATH in Windows

CMG2005 The Java Call Stack As the Java application executes, memory is allocated in the Java Call Stack Frames are pushed and popped on and off the stack as the methods are invoked The state of the Java Call Stack reflects the chain of methods from the initial method called to the current method that is executing

CMG2005 Call Stack top  com.compuware.PayRoll.main(void)  com.compuware.Payroll.CalculateSalary(…)  com.compuware.Payroll.ComputeOverTime(…)  java.lang.String.CharAt(…)  java.lang.String.toLowerCase(…) com.compuware.PayRoll.main(void)  com.compuware.Payroll.CalculateSalary(…)  com.compuware.Payroll.ComputeOverTime(…)  java.lang.String.CharAt(…)  java.lang.String.toLowerCase(…) toLowerCase CharAt ComputeOverTime CalculateSalary main toLowerCase CharAt ComputeOverTime CalculateSalary main Java Application Java Call Stack bottom  The Call Stack is an area of memory that maintains the order in which Java methods are executed When a method is invoked, a “Stack Frame” is “pushed” to the top stack of the stack When the method is completed, it is “popped” off the stack

CMG2005 WAS Architecture

CMG2005 CPS 40.57% Wait 59.43% Session duration 15 minutes CPU 5 min

CMG2005 Libjvm 29.70% Java 41.55%

CMG2005 JVM CPU Usage JVM is the environmental code Java engine that manages the components Usually consumes around 25-35% of the CPU If JVM CPU seems high: upgrade to a newer release apply latest maintenance

CMG2005 Libjitc 4.13%

CMG2005 JITC CPU Usage Java is interpreted by default IBM introduced a Just-in-Time Compiler that will compile methods on the fly MMI (Mixed Mode Interpreter) parm sets threshold that must be reached before compilation Forces distribution of compilation overhead…

CMG2005 JITC CPU Usage … when the JVM initiates, thousands of methods are executed Significant overhead all at once as methods are compiled Possible that it may take longer to initiate the JVM than run the application

CMG2005 JITC CPU Usage JIT on, MMI on (default) JVM will start relatively quickly (interpreted) and runtime performance will improve over time (JITC) JIT off, MMI off JVM will start quickly, but runtime execution will be slow (interpreted) JIT on, MMI off (forces compilation only) JVM will start slowly but runtime will be optimized

CMG2005 JAVAJIT CPU Usage JAVAJIT is the CPU consumed by the total compiled methods in the measurement

CMG2005 JAVAJIT 16.17% Libjitc 26.51%

CMG2005 JAVAJIT 50.01% Libjitc 4.13%

CMG2005 Libzip 5.54%

CMG2005 ZIP Files ZIP files are used to combine multiple class files into one file to reduce I/O overhead, load time, or file transfer time 5.54% may be acceptable (must determine your own benchmarks) Recommendation is to use uncompressed ZIP or JAR files to reduce compression overhead

CMG2005 Class Loading JVM searches the directories in the order they are listed in the CLASSPATH environment variable Class loader has two modes Application mode: search first within the application directory and then the IBM directory J2EE mode: search first in the IBM directory and then the application directory

CMG2005 Class Loading Paths should be reordered so that the most used libraries are found first Package the classes in the order in which they are loaded by the application Do not add unnecessary class files to avoid large files and extra memory usage

CMG2005 JAVA CPU Overhead Computers make it easier to do a lot of things, but most of the things they make it easier to do don’t need to be done. Andy Rooney

CMG2005 JAVA CPU Overhead Hierarchical method invocation requires extra processing for each method call to determine the target (build the call stack) Keep current on JVM releases and maintenance levels Security checks consume CPU (eg 7.6%) Tuning security is a trade-off between performance and integrity

CMG2005 JAVA CPU Overhead Logging always degrades performance Documented techniques to have logging turned on in test but turned off in production Different levels of logging can be customized

CMG2005 Rtrim 3.41%

CMG2005 RTRIM Method Inhouse routine to strip off rightmost bytes of data Developer thought it may be possible to rewrite the application such that RTRIM was not required

CMG2005 The Cost of the RTRIM Method Measurement was for 15 minutes, CPU time was 5 minutes: WAS CPU per hour = 5 minutes x 4 = 20 minutes WAS CPU per year =.3 X 8760 = 2628 hours RTRIM CPU per year = 3.41% of 2628 = 89 hours Total dollar cost of RTRIM per year = $ X 89 = $48, May run in other applications and multiple WAS

CMG2005 MicroValidator 1.65% validateField 0.59%

CMG2005 Validate Method Some kind of validation process Can it be done on another platform? Some less expensive way of validating?

CMG2005 String 3.32% StringBuffer 1.10%

CMG2005 Text Processing (Strings) Strings are immutable Cannot be modified A new StringBuffer object will be created under the covers A new String object is returned via the toString method Beware of text processing in loops

CMG2005 Text Processing (Strings) Several methods generate new instances of objects: concat replace substring trim

CMG2005 Text Processing (Strings) StringBuffers are modifiable Use them to avoid creating temporary String objects Possible alternative solution: use character arrays instead of strings

CMG2005 toUpperCase toLowerCase

CMG2005 Text Processing (Strings) Why are we using these methods? Can they be done on another platform? Is there a better way?

CMG2005 Text Processing (Strings) When parsing a string, pass the length as a parm Otherwise Java must make many calls to the String.length method Use char arrays rather than using String.charAt

CMG2005 Summary JVM – keep up with maintenance JITC – optimize MMI parm ZIP – use judiciously Methods – Always question things: Ask “Why?” Ask “How?” Ask “Is there a better way?”

CMG2005 Summary The opposite of a correct statement is a false statement. The opposite of a profound truth may well be another profound truth. Niels Bohr, Quantum Physicist Common sense is not very common – Latin proverb

CMG2005 Further Reading Diagnostics Guide JDK (SC ) Java Performance Tuning, Jack Shirazi Other books, other websites

CMG2005 No matter what kind of system we have or what the application is, nothing in computer work seems to go as quickly as we think it should. The faster computers move, the more they try our patience. We get a more powerful machine and it still doesn’t process fast enough to satisfy us. Simple as a task might seem to finish, it inevitably takes longer than predicted. There’s always one more thing to get right, to tweak, to test again. Zen Computer Final Thought

CMG2005 Thank you