SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Marcel Mitran – STSM, Architect Java on System z
mmitran@ca.ibm.com
November 20th, 2012




IBM Java PackedObjects: An Overview
IBM Software Group: Java Technology Centre




                                                   © 2012 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



2                                                                               © 2012 IBM Corporation
PackedObject Delivery and Intended Use

PackedObject is an experimental feature in IBM J9 Virtual Machine.


Goal(s) of Feature:
■   Improve serialization and I/O of Java objects
■   Allow direct access to “native” (off-heap) data
■   Allow for explicit source-level representation of compact data-structure



Intended Use:
■   Provide an opportunity for feedback and experimentation
      – Not meant for production support
      – Not a committed language change




3                                                                              © 2012 IBM Corporation
PackedObjects for IBM's Java

        Features of today's Java work well in certain     ...changing how Java data is represented and
                                                        Present data is accessed and used introduces
                                                          native l
               scenarios, poorly in others...
                                                               new efficiencies into the Java language



    ●
      Bloated Objects: Data headers and                   ●
                                                              Shared Headers & No References
    references required to access and use data
    stored outside of Java

    ●
      No direct access to off-heap data: Java
    Native Interface or Direct Byte Buffers
                                                          ●
                                                              Direct access to native stored off-heap
    required when accessing.

    ●
     Redundant Data Copying: Copies of off-
    heap data required to incorporate/act-on              ●
                                                              Elimination of data copies
    changes to source data

    ●
      Suboptimal heap placement: Non-
    adjacent placement of objects in memory               ●
                                                              In-lined data allows for optimal caching
    slows down serialization, garbage collection

4                                                                                             © 2012 IBM Corporation
Speak to me in 'Java', I don't speak 'Native'
■   Java only speaks ‘Java’…
      – Data typically must be copied/(de)serialized/marshalled onto/off Java heap
      – Costly in path-length and footprint




5                                                                                    © 2012 IBM Corporation
On-Heap PackedObjects Example

■   Allows controlled layout of storage of data structures on the Java heap
      – Reduces footprint of data on Java heap
      – No (de)serialization required




    I/O
                 Native storage (20 bytes)



                  Java heap

                                                                               JVM




6                                                                             © 2012 IBM Corporation
Off-Heap Packed Objects Example
■   Enable Java to talk directly to the native data structure
     – Avoid overhead of data copy onto/off Java heap
     – No (de)serialization required




    I/O
                   Native storage (20 bytes)




                       Meta Data
                                                                  JVM




                     Java heap


7                                                               © 2012 IBM Corporation
Example: Distributed Computing High-Level Architecture


                                     Communication between nodes
                                       (RDMA, hyper-sockets, ORB, etc):          Using Java packed objects, data can
                                       ●   Data copy                                  be moved between the
                                       ●   (De)Serialization                          persistency and communication
                                                                                      layers without being copied or
                                                                                      (de)serialized onto/off the Java
    Data persistency on each                                                          heap
         node (DB, file-system,
         etc):
    ●    Data copy
    ●    (De)serialization         DB                                      DB




                                             JVM                                     JVM
                                    App.                                    App.
                                    Server                                  Server



                                  Node                                    Node


8                                                                                                       © 2012 IBM Corporation
© 2012 IBM Corporation


Page 9

 Example: Inter-language Communication
Java requires data
copies, marshalling and   COBOL     Java      C/C++
serialization across
language boundaries       foo(…){   goo(…){   loo(…){
                          …         …         …
                          goo();    loo();    }
                          }         }




Java packed objects
avoids data copies,       COBOL     Java      C/C++
marshaling and
serialization             foo(…){   goo(…){   loo(…){
                          …         …         …
                          goo();    loo();    }
                          }         }
PackedObjects 101
■    A new PackedObject type for the Java language, which allows for:
      – Direct access of data located outside of the Java heap
      – Contiguous allocation of all object's data (objects and arrays)
      – Is not derived from Object, and hence dis-allows assignment and casting
      – Special BoxingPackedObject is glue to reference a PackedObject from Object

                             java/lang/object                             java/lang/PackedObject




      java/math/BigDecimal                       etc…   java/lang/PackedArray                  etc…

                              java/lang/String                             java/lang/PackedString

        java/lang/HashMapEntry        java/lang/BoxedPackedObject   java/lang/PackedHashMapEntry




■    Current Java Capabilities
      – Current Java logic requires language interpreters and data copies for execution.
      – PackedObjects eliminate data copies across the Java Native Interface and the
        need to design and maintain Direct Byte Buffers
■    Using PackedObjects: annotation-based (or later a packed key word) above a class
     definition is required to create a packed class. The class instances can be accessed and
     modified identically to current Java objects
10                                                                                                 © 2012 IBM Corporation
Scope of Implementation
■    “@Packed” class annotation used to define a PackedObject class
■    “@Length” field annotation used to specify length of PackedObject arrays

Proposed Initial Rules
■    Packed types must directly subclass PackedObject
■    Packed inlining can only happen for field declarations which are primitives, PackedObjects or arrays of
     PackedObjects
■    Fields made up of arrays must provide a length that is a compile time constant
■    Regular Java primitive types cannot be used to declare a PackedObject array. Boxed types for
     primitive arrays must be used instead.
■    A field declaration cannot introduce a circular class dependency
■    When a PackedObject is instantiated, only the constructor for the top-level PackedObject is called
■    Local variable assignment and parameter passing of a PackedObject is copy-by-reference
■    BoxedPackedObject is used to box a PackedObject with an Object reference
■    Allocating a PackedObject using the 'new' keyword creates an on-heap PackedObject
■    Off-heap PackedObject creation is done using factory method provided in the class library


11                                                                                                © 2012 IBM Corporation
Code Snippets
■    Packed class definition      ■   On-Heap Packed Allocation




■    Off-heap Packed Allocation




12                                                                © 2012 IBM Corporation
Functionality Changes

                    Current Java                                    PackedObject

Data Field      ■   Object fields limited to primitives or      ■   When allocating a PackedObject, all
Allocation          references to other objects; non-               corresponding data fields get allocated
and Storage         primitives must be initialized and copied       simultaneously and packed into a single
                    into a format understood by Java.               contiguous object (rather than
                                                                    referenced).

                ■   Headers for child objects copied onto       ■   No headers for child objects which all
Child objects
                    the Java heap when accessed.                    share global header on the
                                                                    PackedObject.

 Arrays         ■   For arrays of objects each element in an    ■   Arrays packed together contiguously
                    array has it's own header and a                 under one common header; array length
                    reference to it. The elements are not           marked in PackedObject header. Full
                    contiguous in memory.                           access to elements in array and bounds
                                                                    checking still performed.

Off-heap        ■   Data can not be accessed or modified        ■   Data that does not exist in Java can be
                    outside of the Java heap. Data must be          accessed and modified directly by using
                    converted into a Java version and then          the data's memory location. The Java
                    this copy can then be accessed and              Virtual Machine takes care of the
                    manipulated.                                    accessors and modifiers internally.


13                                                                                               © 2012 IBM Corporation
Off Heap Benefit: Lowers Memory Footprint, increases performance
Before                                                          Native memory               ●
                                                                                             Java requires objects to be in primitive form to be
                              Header                                                        accessed directly*
                                                                                Header
                                                       Hea                                  ●
                                                                                             If objects are not in primitive form, references and
     Header                    Data                       der
                                                                                  Data      copies required to access data; time-consuming
                                                   Data                                     conversion process
       Data
                                reference                                                   ●
                                                                                              When objects are graphed onto the heap, they
              reference
                                                   reference
                                                                                reference
                                                                                            are placed randomly and occupy more space than
                                                                                            is needed
                                               He              Java Heap
                                                  ad
 HEADER




                                            Da     e                       er
                               Header         ta C r                   d                     Memory bloat occurs due to data copies (data
                                                                                            ●
               Data Copy                                           Hea
                                                  opy                     opy               must be accessed and copied, including headers)
                   Header                                              taC
                             Data Copy                            Da
                                                                                                                       *without the use of JNI or DBB




 After                                                                                      ●
                                                                                             PackedObjects eliminate requirement for objects to
                                                                                            be in primitive form
                                                                                            ●
                                                                                             PackedObjects can be accessed directly from source
                                                                                            without the redundant copying; no conversion
                                                                                            ●
                                                                                              PackedObject allocates and packs all data fields
     HEADER




                                                                                            (including other PackedObject and arrays) into a
                            Direct Access, No Copy
                                                                                            single well defined contiguous storage area


14                                                                                                                                 © 2012 IBM Corporation
Copyright and Trademarks



© IBM Corporation 2012. All Rights Reserved.


IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., and 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 – see the IBM “Copyright and
trademark information” page at URL: www.ibm.com/legal/copytrade.shtml




15                                                                                © 2012 IBM Corporation

Weitere ähnliche Inhalte

Was ist angesagt?

Easy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping ToolEasy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping ToolHasitha Guruge
 
Hibernate
HibernateHibernate
HibernateAjay K
 
Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionKelum Senanayake
 
Teradata vs-exadata
Teradata vs-exadataTeradata vs-exadata
Teradata vs-exadataLouis liu
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetJayarajus
 
Introduction to hadoop and hdfs
Introduction to hadoop and hdfsIntroduction to hadoop and hdfs
Introduction to hadoop and hdfsTrendProgContest13
 
Netezza vs Teradata vs Exadata
Netezza vs Teradata vs ExadataNetezza vs Teradata vs Exadata
Netezza vs Teradata vs ExadataAsis Mohanty
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloJulian Arocena
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginnersRahul Jain
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer ReferenceMuthuselvam RS
 
Architecting the Future of Big Data & Search - Eric Baldeschwieler
Architecting the Future of Big Data & Search - Eric BaldeschwielerArchitecting the Future of Big Data & Search - Eric Baldeschwieler
Architecting the Future of Big Data & Search - Eric Baldeschwielerlucenerevolution
 
WORKS 11 Presentation
WORKS 11 PresentationWORKS 11 Presentation
WORKS 11 Presentationdgarijo
 

Was ist angesagt? (19)

Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
 
Easy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping ToolEasy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping Tool
 
Hibernate
HibernateHibernate
Hibernate
 
Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another Introduction
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
Node.js Introduction
Node.js IntroductionNode.js Introduction
Node.js Introduction
 
Teradata vs-exadata
Teradata vs-exadataTeradata vs-exadata
Teradata vs-exadata
 
Jsf+ejb 50
Jsf+ejb 50Jsf+ejb 50
Jsf+ejb 50
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ Nizampet
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Introduction to hadoop and hdfs
Introduction to hadoop and hdfsIntroduction to hadoop and hdfs
Introduction to hadoop and hdfs
 
Netezza vs Teradata vs Exadata
Netezza vs Teradata vs ExadataNetezza vs Teradata vs Exadata
Netezza vs Teradata vs Exadata
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
 
BeJUG JavaFx In Practice
BeJUG JavaFx In PracticeBeJUG JavaFx In Practice
BeJUG JavaFx In Practice
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 
Architecting the Future of Big Data & Search - Eric Baldeschwieler
Architecting the Future of Big Data & Search - Eric BaldeschwielerArchitecting the Future of Big Data & Search - Eric Baldeschwieler
Architecting the Future of Big Data & Search - Eric Baldeschwieler
 
WORKS 11 Presentation
WORKS 11 PresentationWORKS 11 Presentation
WORKS 11 Presentation
 
JSP - Part 1
JSP - Part 1JSP - Part 1
JSP - Part 1
 

Andere mochten auch

Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey J On The Beach
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorRobert Panzer
 
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark Summit
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick GuideAnton Shchastnyi
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesSangjin Lee
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteberndmueller
 
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2Amazon Web Services
 
What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?CA Technologies
 
A Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldA Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldChristoph Engelbert
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pavel Bucek
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenCarola Lilienthal
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java appsSimon Ritter
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016Peter Lawrey
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorTrisha Gee
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Robert Scholte
 
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMN
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMNEin Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMN
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMNOliver Hock
 

Andere mochten auch (20)

Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey Low latency in java 8 by Peter Lawrey
Low latency in java 8 by Peter Lawrey
 
Die Java Plattform Strategie
Die Java Plattform StrategieDie Java Plattform Strategie
Die Java Plattform Strategie
 
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - AsciidoctorPresentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
Presentation Erfolgreiche Software mit großartiger Dokumentation - Asciidoctor
 
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
 
Java Concurrency Quick Guide
Java Concurrency Quick GuideJava Concurrency Quick Guide
Java Concurrency Quick Guide
 
Get Back in Control of your SQL
Get Back in Control of your SQLGet Back in Control of your SQL
Get Back in Control of your SQL
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the Trenches
 
Was jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollteWas jeder Java-Entwickler über Strings wissen sollte
Was jeder Java-Entwickler über Strings wissen sollte
 
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
(GAM404) Hunting Monsters in a Low-Latency Multiplayer Game on EC2
 
What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?What are the Cool Kids Doing With Continuous Delivery?
What are the Cool Kids Doing With Continuous Delivery?
 
A Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe WorldA Post-Apocalyptic sun.misc.Unsafe World
A Post-Apocalyptic sun.misc.Unsafe World
 
Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9Pitfalls of migrating projects to JDK 9
Pitfalls of migrating projects to JDK 9
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigen
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java apps
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the Disruptor
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)Java9 and the impact on Maven Projects (JFall 2016)
Java9 and the impact on Maven Projects (JFall 2016)
 
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMN
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMNEin Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMN
Ein Prozess lernt laufen – LEGO® MINDSTORMS® Steuerung mit BPMN
 

Ähnlich wie IBM Java PackedObjects

Pros/Cons JDBC HIBERNATE EJB
Pros/Cons JDBC HIBERNATE EJBPros/Cons JDBC HIBERNATE EJB
Pros/Cons JDBC HIBERNATE EJBRajkumar Singh
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3Oracle
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.J On The Beach
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment WorkshopChuong Nguyen
 
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...Stephan H. Wissel
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireCarter Shanklin
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch ProcessingChris Adkin
 
DB2 z/OS & Java - What\'s New?
DB2 z/OS & Java - What\'s New?DB2 z/OS & Java - What\'s New?
DB2 z/OS & Java - What\'s New?Laura Hood
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceTim Ellison
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote presoArtur Alves
 
01-Introduction.ppt
01-Introduction.ppt01-Introduction.ppt
01-Introduction.pptEmanAsem4
 
Spring Data for JJUG for Cross Conference Fall
Spring Data for JJUG for Cross Conference Fall Spring Data for JJUG for Cross Conference Fall
Spring Data for JJUG for Cross Conference Fall Toshihiko Ikeda
 
SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloudaidanshribman
 
How to train the jdt dragon
How to train the jdt dragonHow to train the jdt dragon
How to train the jdt dragonAyushman Jain
 
Hibernate(H8) In Action
Hibernate(H8) In ActionHibernate(H8) In Action
Hibernate(H8) In ActionPriyank
 

Ähnlich wie IBM Java PackedObjects (20)

Pros/Cons JDBC HIBERNATE EJB
Pros/Cons JDBC HIBERNATE EJBPros/Cons JDBC HIBERNATE EJB
Pros/Cons JDBC HIBERNATE EJB
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
A Java Implementer's Guide to Boosting Apache Spark Performance by Tim Ellison.
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop04.egovFrame Runtime Environment Workshop
04.egovFrame Runtime Environment Workshop
 
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
SHOW107: The DataSource Session: Take XPages data boldly where no XPages data...
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFire
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
DB2 z/OS & Java - What\'s New?
DB2 z/OS & Java - What\'s New?DB2 z/OS & Java - What\'s New?
DB2 z/OS & Java - What\'s New?
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote preso
 
01-Introduction.ppt
01-Introduction.ppt01-Introduction.ppt
01-Introduction.ppt
 
Spring Data for JJUG for Cross Conference Fall
Spring Data for JJUG for Cross Conference Fall Spring Data for JJUG for Cross Conference Fall
Spring Data for JJUG for Cross Conference Fall
 
SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloud
 
How to train the jdt dragon
How to train the jdt dragonHow to train the jdt dragon
How to train the jdt dragon
 
Java and Mongo
Java and MongoJava and Mongo
Java and Mongo
 
Hibernate(H8) In Action
Hibernate(H8) In ActionHibernate(H8) In Action
Hibernate(H8) In Action
 
Lec 2 30_jul13
Lec 2 30_jul13Lec 2 30_jul13
Lec 2 30_jul13
 

Kürzlich hochgeladen

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 

Kürzlich hochgeladen (20)

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 

IBM Java PackedObjects

  • 1. Marcel Mitran – STSM, Architect Java on System z mmitran@ca.ibm.com November 20th, 2012 IBM Java PackedObjects: An Overview IBM Software Group: Java Technology Centre © 2012 IBM Corporation
  • 2. 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 2 © 2012 IBM Corporation
  • 3. PackedObject Delivery and Intended Use PackedObject is an experimental feature in IBM J9 Virtual Machine. Goal(s) of Feature: ■ Improve serialization and I/O of Java objects ■ Allow direct access to “native” (off-heap) data ■ Allow for explicit source-level representation of compact data-structure Intended Use: ■ Provide an opportunity for feedback and experimentation – Not meant for production support – Not a committed language change 3 © 2012 IBM Corporation
  • 4. PackedObjects for IBM's Java Features of today's Java work well in certain ...changing how Java data is represented and Present data is accessed and used introduces native l scenarios, poorly in others... new efficiencies into the Java language ● Bloated Objects: Data headers and ● Shared Headers & No References references required to access and use data stored outside of Java ● No direct access to off-heap data: Java Native Interface or Direct Byte Buffers ● Direct access to native stored off-heap required when accessing. ● Redundant Data Copying: Copies of off- heap data required to incorporate/act-on ● Elimination of data copies changes to source data ● Suboptimal heap placement: Non- adjacent placement of objects in memory ● In-lined data allows for optimal caching slows down serialization, garbage collection 4 © 2012 IBM Corporation
  • 5. Speak to me in 'Java', I don't speak 'Native' ■ Java only speaks ‘Java’… – Data typically must be copied/(de)serialized/marshalled onto/off Java heap – Costly in path-length and footprint 5 © 2012 IBM Corporation
  • 6. On-Heap PackedObjects Example ■ Allows controlled layout of storage of data structures on the Java heap – Reduces footprint of data on Java heap – No (de)serialization required I/O Native storage (20 bytes) Java heap JVM 6 © 2012 IBM Corporation
  • 7. Off-Heap Packed Objects Example ■ Enable Java to talk directly to the native data structure – Avoid overhead of data copy onto/off Java heap – No (de)serialization required I/O Native storage (20 bytes) Meta Data JVM Java heap 7 © 2012 IBM Corporation
  • 8. Example: Distributed Computing High-Level Architecture Communication between nodes (RDMA, hyper-sockets, ORB, etc): Using Java packed objects, data can ● Data copy be moved between the ● (De)Serialization persistency and communication layers without being copied or (de)serialized onto/off the Java Data persistency on each heap node (DB, file-system, etc): ● Data copy ● (De)serialization DB DB JVM JVM App. App. Server Server Node Node 8 © 2012 IBM Corporation
  • 9. © 2012 IBM Corporation Page 9 Example: Inter-language Communication Java requires data copies, marshalling and COBOL Java C/C++ serialization across language boundaries foo(…){ goo(…){ loo(…){ … … … goo(); loo(); } } } Java packed objects avoids data copies, COBOL Java C/C++ marshaling and serialization foo(…){ goo(…){ loo(…){ … … … goo(); loo(); } } }
  • 10. PackedObjects 101 ■ A new PackedObject type for the Java language, which allows for: – Direct access of data located outside of the Java heap – Contiguous allocation of all object's data (objects and arrays) – Is not derived from Object, and hence dis-allows assignment and casting – Special BoxingPackedObject is glue to reference a PackedObject from Object java/lang/object java/lang/PackedObject java/math/BigDecimal etc… java/lang/PackedArray etc… java/lang/String java/lang/PackedString java/lang/HashMapEntry java/lang/BoxedPackedObject java/lang/PackedHashMapEntry ■ Current Java Capabilities – Current Java logic requires language interpreters and data copies for execution. – PackedObjects eliminate data copies across the Java Native Interface and the need to design and maintain Direct Byte Buffers ■ Using PackedObjects: annotation-based (or later a packed key word) above a class definition is required to create a packed class. The class instances can be accessed and modified identically to current Java objects 10 © 2012 IBM Corporation
  • 11. Scope of Implementation ■ “@Packed” class annotation used to define a PackedObject class ■ “@Length” field annotation used to specify length of PackedObject arrays Proposed Initial Rules ■ Packed types must directly subclass PackedObject ■ Packed inlining can only happen for field declarations which are primitives, PackedObjects or arrays of PackedObjects ■ Fields made up of arrays must provide a length that is a compile time constant ■ Regular Java primitive types cannot be used to declare a PackedObject array. Boxed types for primitive arrays must be used instead. ■ A field declaration cannot introduce a circular class dependency ■ When a PackedObject is instantiated, only the constructor for the top-level PackedObject is called ■ Local variable assignment and parameter passing of a PackedObject is copy-by-reference ■ BoxedPackedObject is used to box a PackedObject with an Object reference ■ Allocating a PackedObject using the 'new' keyword creates an on-heap PackedObject ■ Off-heap PackedObject creation is done using factory method provided in the class library 11 © 2012 IBM Corporation
  • 12. Code Snippets ■ Packed class definition ■ On-Heap Packed Allocation ■ Off-heap Packed Allocation 12 © 2012 IBM Corporation
  • 13. Functionality Changes Current Java PackedObject Data Field ■ Object fields limited to primitives or ■ When allocating a PackedObject, all Allocation references to other objects; non- corresponding data fields get allocated and Storage primitives must be initialized and copied simultaneously and packed into a single into a format understood by Java. contiguous object (rather than referenced). ■ Headers for child objects copied onto ■ No headers for child objects which all Child objects the Java heap when accessed. share global header on the PackedObject. Arrays ■ For arrays of objects each element in an ■ Arrays packed together contiguously array has it's own header and a under one common header; array length reference to it. The elements are not marked in PackedObject header. Full contiguous in memory. access to elements in array and bounds checking still performed. Off-heap ■ Data can not be accessed or modified ■ Data that does not exist in Java can be outside of the Java heap. Data must be accessed and modified directly by using converted into a Java version and then the data's memory location. The Java this copy can then be accessed and Virtual Machine takes care of the manipulated. accessors and modifiers internally. 13 © 2012 IBM Corporation
  • 14. Off Heap Benefit: Lowers Memory Footprint, increases performance Before Native memory ● Java requires objects to be in primitive form to be Header accessed directly* Header Hea ● If objects are not in primitive form, references and Header Data der Data copies required to access data; time-consuming Data conversion process Data reference ● When objects are graphed onto the heap, they reference reference reference are placed randomly and occupy more space than is needed He Java Heap ad HEADER Da e er Header ta C r d Memory bloat occurs due to data copies (data ● Data Copy Hea opy opy must be accessed and copied, including headers) Header taC Data Copy Da *without the use of JNI or DBB After ● PackedObjects eliminate requirement for objects to be in primitive form ● PackedObjects can be accessed directly from source without the redundant copying; no conversion ● PackedObject allocates and packs all data fields HEADER (including other PackedObject and arrays) into a Direct Access, No Copy single well defined contiguous storage area 14 © 2012 IBM Corporation
  • 15. Copyright and Trademarks © IBM Corporation 2012. All Rights Reserved. IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., and 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 – see the IBM “Copyright and trademark information” page at URL: www.ibm.com/legal/copytrade.shtml 15 © 2012 IBM Corporation