java on the mainframe
TRANSCRIPT
![Page 1: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/1.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Java on the MainframeJavagruppen,
Copenhagen, 27th October 2015
Michael Erichsen,Xact Consulting A/S,
![Page 2: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/2.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Introduction
![Page 3: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/3.jpg)
COBOL is Native to the Mainframe
![Page 4: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/4.jpg)
Java is also NativeIt was just born later
![Page 5: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/5.jpg)
Good or Bad?
![Page 6: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/6.jpg)
Old or New?
• OO is just a way to do somecategories of computing– Not something given to Moses
on tablets
• The first OO language, Simula,was formalized in 1962-1965
• COBOL was formalized in 1959-60
6
![Page 7: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/7.jpg)
When I’m Good I run your Payroll
![Page 8: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/8.jpg)
When I’m Bad you have overseen a ”.”
![Page 9: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/9.jpg)
When I’m good I run stuff like Watson
![Page 10: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/10.jpg)
When I’m Bad you’ll get a Null Pointer Exception
![Page 11: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/11.jpg)
Paradigm Shifts
11
Batch OLTP Client/Server WWW Mobile/IOT
Flat files Databases Relational NoSQL ...
Unstructuredmachine
instructions
Procedurallanguages
Objectoriented
Parallelprocessing ...
![Page 12: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/12.jpg)
IBM’s Competition
12
Burroughs,Univac, ICL,Honeywell...
Oracle,Tuxedo,Unikix
Sun, DEC,Microsoft
WebLogic,Tomcat
Apple,Google,Amazon
Burroughs,Univac, ICL,Honeywell...
Adabas,Datacom Oracle OSS ...
Burroughs,Univac, ICL,Honeywell...
MicrosoftBasic C# ... ...
![Page 13: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/13.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Why Java?
![Page 14: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/14.jpg)
Sun wanted to confront Microsoft
• Killer hardware– The SPARC processor
• “An industrial-strength Smalltalk, written in C++“– Dropped C++– Dropped ObjectiveC– Then “Oak”– Then “Java”
• Lost the Browser war – strong on the server side – underconstant attack for security
![Page 15: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/15.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Why Java on Mainframe
![Page 16: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/16.jpg)
Java on the Big Iron
• Open the mainframe to a new generation of developers• Portability of applications• But also
– IBM wanted to confront Microsoft too– Microsoft exerted an aggressive dominance– Hard to imagine in these Apple, Google and Facebook times?– At that point in time it was ”EAM”: Everybody Against Microsoft
![Page 17: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/17.jpg)
IBM has always been Competition driven
Why invent a mainframe whenyou made most of your moneyon selling small pieces ofcardboard?
Why invent a PC when you mademost of your money onmainframes?
![Page 18: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/18.jpg)
Which Runtimes? All of them!
• Batch– BPX– JZOS
• CICS– OSGi– Liberty– PHP– Mobile– Servlets– JSP– SAML– JDBC Type 4– JCICS
• DB2– SQLJ– JDBC type 2– JDBC type 4
• IMS– JMP– JDBC
• MQ– WMQ API– jms
• WAS– ”Classic”– Liberty
• zLinux
![Page 19: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/19.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Development of Java on the Mainframe
![Page 20: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/20.jpg)
Mainframe Issues
• Processor technology• Virtualization• Changing implementations• Garbage Collection Policies
![Page 21: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/21.jpg)
Processor Technology
• Mainframe processors optimized for batch I/O and OLTP– Data intensive– ”Invisible” extra processors for I/O
• Java developed on the opposite types of processors– Numeric intensive
• IBM’s challenges– Change the processors to accomodate for Java– Adapt the JVM to IBM Hardware– Specialized processors for special tasks
![Page 22: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/22.jpg)
Processor Development
• Java is a very high priority for z series mainframes• The IBM hardware lab works hard to satisfy requirements from
the IBM Java lab• 1998 COBOL/Java performance were perhaps 1/200• 2015 it is close to even• New functionality tends to be implemented in Java before
other languages like COBOL and PL/I– New compiler technology, DWARF debugging
![Page 23: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/23.jpg)
Early steps
• GZIP accelleration in hardware• UTF conversion
– ”CONVERT UTF-16 TO UTF-8” is a single instruction!• Cryptograpic Instructions
– z/OS subsystem– Offloaded to crypto coprocessors
• XML z/OS subsystem• Each step then implemented in an IBM JVM version
– I recommend you always stay on the highest level of hardware and JVM!
![Page 24: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/24.jpg)
Z196
• Out-of-order pipeline design, larger cache structure, higherclock speed
• 70+ new instructions used by Java• Conditional-load/store• Non-destructive operands• Interlock facility update for better Java concurrency
![Page 25: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/25.jpg)
EC12• Hardware Transaction Memory (HTM)
– Better concurrency for multi-threaded applications eg. ~2X improvement to juc.ConcurrentLinkedQueue• Run-time Instrumentation (RI)
– Innovation new h/w facility designed for managed runtimes– Enables new expanse of JRE optimizations
• 2GB page frames (no zVM)– Improved performance targeting 64-bit heaps
• Pageable 1MB large pages using flash– Better versatility of managing memory
• New software hints/directives– Data usage intent improves cache management– Branch pre-load improves branch prediction
• New trap instructions– Reduce overhead of implicit bounds/null checks
![Page 26: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/26.jpg)
z13
• Java 8 improvements• Simultaneous Multi-Threading (SMT)
– 2x hardware threads/core for improved throughput– Also available on zIIP and IFL
• Single Instruction Multiple Data (SIMD)– Vector processing unit– Accelerates loops and string operations
• Cryptographic Function (CPACF)– Improved performance of crypto co-processors
![Page 27: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/27.jpg)
Virtualization
• Mainframe has excelled in virtual storage and machines sincethe 1960’es– Based on a set of civilized traffic rules in a multi-tenant system
• Java has its own Virtual Machine– Raised as a spoiled only child with no manners– Grabs all the storage it can immediately– Has been handled in different ways over time
• JVM on top of Virtual Storage on top of z/VM on top ofPR/SM...?
![Page 28: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/28.jpg)
HPJ (”High Performance Java”)
• In the beginning it was impossible for IBM to make a JVMperform
• Initialization cost of a JVM: 20.000.000 instructíons• HPJ ran as a fully compiled Language Environment load module
– Performed like C (which is probably what it really was?)– Still humongeous startup cost
• Impossible for IBM to have their HPJ compiler support all thenew functionality pouring into Java (Only 1.1)
![Page 29: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/29.jpg)
Reuse – Reset – Continuous...
• IBM switched focus to the JVM and tried various strategies• Reusable
– Keep the environment running for exactly the same program• Resettable
– Keep the JVM running, but reset the environment• Continuous
– More sharing, JIT• Since then
– Still more sharing, more threads, 64 bit
![Page 30: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/30.jpg)
Garbage CollectionJava has no explicit allocationand deallocationDeallocation done as GarbageCollection
– All active objects marked andcopied away
– All unused deleted bycompacting storage
– Done in different pools tohandle short and long livedobjects separately
![Page 31: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/31.jpg)
Garbage Collection Issues
• Pause time• Pause predictability• CPU usage• Memory footprint
– Virtual footprint– GC interaction with paging and
swapping• The unimaginable memory leaks
– Unintended object retention
![Page 32: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/32.jpg)
IBM JVM Garbage Collection Policies
• Four GC policies – optimized for different scenarios– -Xgcpolicy:optthruput
• For “batch” type apps
– -Xgcpolicy:optavgpause• For apps with responsiveness criteria
– -Xgcpolicy:gencon• Highly transactional workloads
– -Xgcpolicy:subpools• Large systems with allocation contention
![Page 33: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/33.jpg)
gencon• Generational & concurrent GC collector introduced with IBM JVM 1.5
– It does split the Java Heap space between nursery and tenured spaces– Nursery (YoungGen) space objects are collected separately via the scavenger GC
collector– Tenured space objects are collected via the global GC collector– The GC collector is concurrent and taking advantage of any multi physical cores
machine• Results:
– Reduced major collection frequency (Full GC)– Reduced Full GC elapsed time & pause time– Increase JVM throughput– Increase performance & capacity of your application
![Page 34: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/34.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Challenges
![Page 35: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/35.jpg)
Challenges
• Hardware has been optimized for Java• JVM has been optimized for z/OS• Still a number of challenges
– Sizing of heaps and underlying layers– Startup CPU usage– Batch
![Page 36: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/36.jpg)
Heap Sizes
• Java heap size tuning is an art– Small heaps get filled up quickly => GC often– Large heaps holds a lot of objects => GC takes a long time (”Stop the
World”)– Need tools, measurements, statistics and tuning
• Java heaps lives on top of Language Environment heaps andz/OS virtual storage– LE heaps can be measured and tuned– Paging and swapping can be the result of overallocating heaps
![Page 37: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/37.jpg)
Or you can just buy more Real Storage...
![Page 38: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/38.jpg)
JVM startup overhead
A full scale two LPAR share-allclassic WebSphere ApplicationServer startup?!?
Time for a BIG cup of coffee...
![Page 39: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/39.jpg)
IBM Heap Analyzer
![Page 40: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/40.jpg)
IBM Health Center, GC Perspective
![Page 41: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/41.jpg)
IBM Garbage Collection and Memory Visualizer
![Page 42: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/42.jpg)
More Tools
• IBM Extensions for Memory Analyzer• IBM Interactive Diagnostic Data Explorer
– All available with ISA, IBM Support Assistant, at no separate cost
• Perhaps your favourite Monitor product has support?– Omegamon, TMON, Mainview, Sysview...
![Page 43: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/43.jpg)
Batch
• BPXBATCH is the normal Unix Systems Services batchimplementation
• JZOS is a custom JVM launcher for z/OS– Built by 3rd party as Open Source– Bought by IBM and added to z/OS– Better Java support– Better DB2 interface
• “Modern batch” is a different story
![Page 44: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/44.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Development
![Page 45: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/45.jpg)
Plain Java Development
• All Java tools can be used• Rational Developer for z has support for special API’s like JCICS• The IBM JVM is 100% compatible with Sun/Oracle from the
development side– Differences only in JVM implementation and in toolbox
![Page 46: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/46.jpg)
Mixed Language Development
• OO COBOL was originally intended to redefine COBOL as an OOlanguage– This has been dropped to let OO and COBOL each do what they are best at
• OO COBOL remains as an interface to call COBOL from Java– Allows you to define classes with methods in Cobol– Create instances of Java and Cobol classes– Invoke methods on Java and Cobol objects– Write classes that inherit from Java or Cobol classes– Overload methods
![Page 47: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/47.jpg)
Mixed Language Development• In Enterprise Cobol you can also invoke the Java Native Interface (JNI) to
obtain other Java-oriented capabilities• Function pointers for JNI services are in the JNI Environment Structure• New special register JNIEnvPtr• Linkage section
– COPY 'JNI.cpy'
• Procedure division– Set address of JNIEnv to JNIEnvPtr– Set address of JNINativeInterface to JNIEnv– Invoke aJavaObject 'someJavaMethod'– Invoke exceptionObject 'PrintStackTrace'
![Page 48: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/48.jpg)
Storage Differences
• Storage is static in COBOL,HLASM, PL/I etc.
• Storage is dynamic in Java• You can call from Java to
COBOL with an area that hasnot yet been allocated by Java– Storage violations– Null pointer exceptions
![Page 49: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/49.jpg)
Deployment
• OSGi has been added to CICS– Being extended to COBOL and
PL/I
• Elsewhere later?
![Page 50: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/50.jpg)
Security
• EJBROLE– Member class for Enterprise Java
Beans authorization roles• GEJBROLE
– Grouping class for Enterprise JavaBeans authorization roles
• JAVA– Contains profiles that are used by
Java for z/OS applications toperform authorization checking forJava for z/OS resources
![Page 51: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/51.jpg)
EJBROLE Examples
• ADMINISTRATOR• ADMINSECURITYMANAGER• BBNBASE.deployer• BBNBASE.CosNamingCreate• COSNAMINGCREATE• OPERATOR• IZUDFLT.*.izuUsers (G)
• isCallerInRole()• isUserInRole()
![Page 52: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/52.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Economy
![Page 53: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/53.jpg)
Processor Economy
• IFL– Integrated Facility for Linux– Same processor, reduced price
• zIIP– System z Integrated Information Processor
![Page 54: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/54.jpg)
Contract Economy• zNALC
– System z New Application License Charges– Reduced price on LPAR with ”new workload” such as Java on WAS
• VUE– Value Unit Edition– One time charge for eligible workloads in such LPAR
• MWP– Mobile Workload Pricing for z/OS– Extra load must be documented
• This is not Java specific, but can improve your business case
![Page 55: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/55.jpg)
The Last Words
![Page 56: Java on the Mainframe](https://reader031.vdocuments.us/reader031/viewer/2022013013/58d1113d1a28ab823e8b66ef/html5/thumbnails/56.jpg)
FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre
+45 7023 [email protected]
Enterprise Modernization
Moderniza-tion
Conversion
Business
SoftwareConsultants