SlideShare a Scribd company logo
No Heap Remote Objects for Distributed
Real-Time Java

      Pablo Basanta-Val, Marisol García-Valls,
              and Iria Estévez-Ayres
               mailto:pbasanta@it.uc3m.es


†Jornadas de Tiempo Real 2011- Madrid(     )
  Publicado en ACM Transactions On Embedded Systems
Outline
• Context and Motivation
• No-Heap Remote Objects
  – Basic Model
     • Programming model
     • Example
     • Performance
  – Extended Model
     • Programming patterns
     • Extended model
     • Performance
• Conclusion and ongoing work
                                2
Memory management for real-
time Java
• Techniques used for memory management in real-time Java
  (RTSJ)
   – Auto-managed memory (object pools)
   – Garbage collection (and its RT* variants)
   – Regions (ScopedMemory)
• Memory management issues in distributed real-time Java
  (DRTSJ)
   – Real-time garbage collection
   – Distributed Garbage Collection
   – Regions
• Current garbage collectors may be not enough for
  distributed real-time applications
   – E.g. a heap with 1Gb may introduce a 30 seconds delay
                                  JRT-11                     3
State of the art
Denomination       Technologies   Goals
                     RT- CORBA+    Implementation of RT-CORBA with RTSJ
 RTZen
                     RTSJ
 DRTSJ               RMI+RTSJ       A specification for distributed real-time Java

 RT-RMI-York         RMI+RTSJ       A framework for distributed real-time Java.

 RT-RMI-UPM          RMI+RTSJ       Profiles for distributed real-time Java

 DRTJava-on-CSP      CSP+Java       Produce an alternative based on CSP formalisms

 RTJ-COM             RTSJ           A component framework for embedded Java

 Scratchpad          RTSJ           A no-heap component model for real-time Java
                                    A distributed real-time object-oriented platform
 APICOM              RTSJ +CAN


• There is not a simple technique to remove the GC’s from the
  server side !!!
    •    RTZen hybrid approach,
    •    DRTSJ , RTRMI-York, RTRMI-UPM take non-heap as a requirement
                                    JRT-11                                             4
RTSJ region-based memory model

 • Three types of memory areas       :O1=new Object
   – Heap
   – Immortal Memory (I)
   – Scoped Memory (Sx)
                                                O1
 • A selector mechanism               Sa
                                                         1
   – One scope stack per thread
   – Enter, executeInArea             Sb
                                                O2
                                                         1
 • Destruction mechanism              I
   – Stack discipline (counter)
 • Safety mechanism                        Scope Stack

   – Assignment rule
   – Single parent rule           Forbidden assignment
                                  Default allocation
                                                  5
                                  context
Calculator()   Calculator()


NhRo: memory model
                                                    lastInteger    lastInteger


                                                    add()          add()
                                                    lastResult()   lastResult()
                                                    doNothing()    doNothing()


• Fragmented memory model
   – Creation Context
      • Represents the state of the remote object
   – Invocation Context
      • Objects created during remote invocation
• Safe nesting of contexts
   – NhRo-rule: references from creation to invocation are
     forbidden
   – References from invocation to creation are allowed



                                                                           6
NhRo:
Example




          JRT-11   7
NhRo: Impact on the middleware
Scoped or Immortal




                     CalculatorImpl_Stub                          CalculatorImpl
                                                                      lastInteger
                             add()                                       add()
                          lastResult()                               lastResult()
                         doNothing()                                doNothing()                                                   Programmer
                                                                                                                                  Layer


                                                             ObjId Ref CC




                                                                                                             Invocation max
                                                                                          Invocation 1
                                                             CalcID
 Immortal memory




                                                                                                         0


                                                                                                                              0
                                                             Remote Object Table Thread   Memory Area
                                                                                 Pool     Pool        Middleware
                                                                                                                                  Layer


                                                 JRMP/IIOP
                                     Transport               Transport

                                                                                                                                  RTSJ
                                                                                                                                  Virtual
                                                                                                                                  Machine
                     Client                                                  Server
                                                                                                                                            8
NhRo in action
                                                            Calculator()      Creation Context
                                                            lastInteger
                                                                              (Immortal Memory)
                                                            add()
                                                            lastResult()        Invoc. Context
                                                            doNothing()
                                                                                (LTMemory)


                                                      CalcID   Ref




                                                  OBJId Table


                                              enter

                                                        0      0     1
                                                                     0

                                    Thread        Memory Area                            objID a      b
                                    pool          pool


                                                                                         meth tmp ser
                                                                                                      1
                                      Transport
CalcID.add(DataInt(3),DataInt(4))                                                      Middleware
                                                                           Program
          DataInt(7)                                                       created     created
                                                                           object      object     9
NhRo vs. traditional
                                                    GC’d remote objects

                               Garbage collector RTSJ-RI          Memory area pool                                         Garbage collector RTSJ-RI          Memory area pool
                      8
                                                                                                                16
                      7
                                                                                                                14
                      6
Consummed time (ms)




                                                                                                                12




                                                                                          Consummed time (ms)
                      5
                                                                                                                10
                      4
                                                                                                                8
                      3
                                                                                                                6
                      2                                                                                         4
                      1                                                                                         2
                      0                                                                                         0
                          1   21      41       61          81   101   121      141
                                                                                                                     752




                                                                                                                              1286




                                                                                                                                            1910




                                                                                                                                                       2534




                                                                                                                                                                    3158
                                                                                 sample
                                                                                                                                                                 Alive memory (kB)




                                                                                     JRT-11                                                                                 10
Enhancements to the basic NhRo
model
• Patterns for programming with NhRos
• NhRo stored in scoped memory
  – Scope stack characterization
  – Changes in the middleware
  – Policies for the memory are pool
• Performance issues
  – Dependency on data transmitted


                        JRT-11          11
Calculator()



NhRo: constraints (I)
                                                lastInteger


                                                add()
                                                lastResult()
                                                doNothing()



• NhRo-rule limitations
  – Objects is creation context are destroyed after
    remote invocation by default


• Two patterns to avoid the problem
  – Copy pattern
  – Extended portals



                                                          12
NhRo: Scope Stack at the server




                                                                                          Invocation
                                                                                          context
 :RO1=new RemoteObject                                          Sinv1   a b
                                                 Handler                       1
                                                 Thread
        Sa   RO1                                                Sa      RO1




                                                                                        Creation context
                              Creation context
                        1                                                      1

        Sb                                                      Sb             1
                        1

        I                                                       I

 Scope Stack                                               Scope Stack
 (during remote object creation)                           (during remote invocation)


   •   Creation context: state of the remote object
   •   Invocation context: parameters of remote invocation                                                 13
Decoupling middleware
implemenation from NhRos




              JRT-11       14
Invocationnumber


Memory Area Pool




                                                                       Invocationsize
                                                    0       0     0

                                            Memory Area
• It stores LTMemory instances only         Pool



• It requires two configuration parameters
   – Number of instances in the pool
   – Memory associated to each invocation context

• Auto-collection
   – Invocation context returns automatically to its pool when
     they are not used
      • Internal counter 1→0
      • Avoids memory area leakage



                                                                      15
bytes




                            5000




                        0
                                         10000
                                                                         15000
                                                                                     20000
                                                                                             25000
                                                                                                     30000
                void
            boolean
                byte
                char
               short
                  int
                long
                float
             double
                 null
                Byte
               Short
             Integer
               Long
               Float
             Double
          Character




X
            Boolean
    RtUnRemOb
             String()




JRT-11
          String(10)
                                                                                                             and LTMemory size




          String(25)
          String(50)
         String(100)
           Object[0]
         Object[10D]
         Object[25D]
         Object[50D]
    Object[100D]
           Vector(0)
     Vector(10D)
     Vector(25D)
     Vector(50D)
    Vector(100D)
                                                                                                             Remove invocation parameters




                                   X echo(X)
                                                 X doNothing()
                                                                 void doNothing(X)




16
NhRos vs. (RT*) Garbage Collectors [new]




                  JRT-11               17
Conclusions
• This work has introduced a model able to remove
  the garbage collection from the end-to-end path
   – NhRo model
• Empirical results showed:
   – Its implementation in basic environments is simple
   – The performance patterns offered are powerful




                             JRT-11                       18
Ongoing Work-
• To produce an analytic model for the NhRo
   – Use of heap, and different threads
   – Identification of useful combinations
• Analyze the parentage-rules proposed by Higuera-
  Toledano and integrate them with NhRos
   – A more restricted model




                               JRT-11                19
JRT-11   20

More Related Content

PPT
Simple asynchronous remote invocations for distributed real-time Java
PPT
PPT
Enhancing the region model of RTSJ
PPT
A synchronous scheduling service for distributed real-time Java
PDF
[JavaOne 2011] Models for Concurrent Programming
PDF
Exploiting Concurrency with Dynamic Languages
Simple asynchronous remote invocations for distributed real-time Java
Enhancing the region model of RTSJ
A synchronous scheduling service for distributed real-time Java
[JavaOne 2011] Models for Concurrent Programming
Exploiting Concurrency with Dynamic Languages

What's hot (20)

PPT
Jvm Performance Tunning
PDF
Let's talk about Garbage Collection
PDF
[GEG1] 10.camera-centric engine design for multithreaded rendering
PPTX
General Purpose Computing using Graphics Hardware
PDF
Java in flames
PPT
Deuce STM - CMP'09
PPT
Java Performance Tuning
PDF
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
PPTX
Seeing with Python presented at PyCon AU 2014
PPTX
java memory management & gc
PDF
Qt everywhere a c++ abstraction platform
PDF
Using Flame Graphs
PPT
Clockless design language - ilia greenblat
PDF
Qt Quick in depth
PDF
Marco Cattaneo "Event data processing in LHCb"
PPT
An Introduction to JVM Internals and Garbage Collection in Java
PDF
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
ODP
Quick introduction to Java Garbage Collector (JVM GC)
PDF
Tr ns802 11
PDF
The new ehcache 2.0 and hibernate spi
Jvm Performance Tunning
Let's talk about Garbage Collection
[GEG1] 10.camera-centric engine design for multithreaded rendering
General Purpose Computing using Graphics Hardware
Java in flames
Deuce STM - CMP'09
Java Performance Tuning
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Seeing with Python presented at PyCon AU 2014
java memory management & gc
Qt everywhere a c++ abstraction platform
Using Flame Graphs
Clockless design language - ilia greenblat
Qt Quick in depth
Marco Cattaneo "Event data processing in LHCb"
An Introduction to JVM Internals and Garbage Collection in Java
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
Quick introduction to Java Garbage Collector (JVM GC)
Tr ns802 11
The new ehcache 2.0 and hibernate spi
Ad

Similar to No Heap Remote Objects for Distributed real-time Java (20)

PDF
What is new and cool j2se & java
PDF
Stefano Giordano
PDF
Stefano Giordano
PDF
Porting a Streaming Pipeline from Scala to Rust
PDF
MARC ONERA Toulouse2012 Altreonic
PDF
Haskell Symposium 2010: An LLVM backend for GHC
PDF
XS Boston 2008 Paravirt Ops in Linux IA64
PDF
The Visualization Toolkit (VTK) and why you might care about it
PDF
Windows Azure Interoperability
PDF
State of the art: Server-Side JavaScript (ParisJS)
PPT
Intro to Cloudstack
PDF
An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011
PDF
ScalableCore System: A Scalable Many-core Simulator by Employing Over 100 FPGAs
PDF
2010-02-09 Reactor Pattern & Event Driven Programming
PDF
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
PDF
2012 11 Openstack China
PDF
Open Safety-Critical Java
PDF
XS Japan 2008 Xen Mgmt English
PDF
Android RenderScript on LLVM
PPTX
Evented Ruby VS Node.js
What is new and cool j2se & java
Stefano Giordano
Stefano Giordano
Porting a Streaming Pipeline from Scala to Rust
MARC ONERA Toulouse2012 Altreonic
Haskell Symposium 2010: An LLVM backend for GHC
XS Boston 2008 Paravirt Ops in Linux IA64
The Visualization Toolkit (VTK) and why you might care about it
Windows Azure Interoperability
State of the art: Server-Side JavaScript (ParisJS)
Intro to Cloudstack
An FPGA-based Scalable Simulation Accelerator for Tile Architectures @HEART2011
ScalableCore System: A Scalable Many-core Simulator by Employing Over 100 FPGAs
2010-02-09 Reactor Pattern & Event Driven Programming
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
2012 11 Openstack China
Open Safety-Critical Java
XS Japan 2008 Xen Mgmt English
Android RenderScript on LLVM
Evented Ruby VS Node.js
Ad

More from Universidad Carlos III de Madrid (8)

PPT
Tecnicas y extensiones para Java de tiempo real
PPTX
Towards a garbage collector for distributed real-time Java
PDF
A simple data muling protocol
PDF
Mejoras a la predictibilidad de la tecnología Java EE
PPTX
Remote Memory Areas for distributed real-time Java
PDF
Towards a real-time reconfiguration service for distributed Java
PPT
Pbasanta@jtres06 extendedportal
Tecnicas y extensiones para Java de tiempo real
Towards a garbage collector for distributed real-time Java
A simple data muling protocol
Mejoras a la predictibilidad de la tecnología Java EE
Remote Memory Areas for distributed real-time Java
Towards a real-time reconfiguration service for distributed Java
Pbasanta@jtres06 extendedportal

Recently uploaded (20)

PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
Pharma ospi slides which help in ospi learning
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Business Ethics Teaching Materials for college
PDF
01-Introduction-to-Information-Management.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Pharma ospi slides which help in ospi learning
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
VCE English Exam - Section C Student Revision Booklet
Business Ethics Teaching Materials for college
01-Introduction-to-Information-Management.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
RMMM.pdf make it easy to upload and study
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Insiders guide to clinical Medicine.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

No Heap Remote Objects for Distributed real-time Java

  • 1. No Heap Remote Objects for Distributed Real-Time Java Pablo Basanta-Val, Marisol García-Valls, and Iria Estévez-Ayres mailto:pbasanta@it.uc3m.es †Jornadas de Tiempo Real 2011- Madrid( ) Publicado en ACM Transactions On Embedded Systems
  • 2. Outline • Context and Motivation • No-Heap Remote Objects – Basic Model • Programming model • Example • Performance – Extended Model • Programming patterns • Extended model • Performance • Conclusion and ongoing work 2
  • 3. Memory management for real- time Java • Techniques used for memory management in real-time Java (RTSJ) – Auto-managed memory (object pools) – Garbage collection (and its RT* variants) – Regions (ScopedMemory) • Memory management issues in distributed real-time Java (DRTSJ) – Real-time garbage collection – Distributed Garbage Collection – Regions • Current garbage collectors may be not enough for distributed real-time applications – E.g. a heap with 1Gb may introduce a 30 seconds delay JRT-11 3
  • 4. State of the art Denomination Technologies Goals RT- CORBA+ Implementation of RT-CORBA with RTSJ RTZen RTSJ DRTSJ RMI+RTSJ A specification for distributed real-time Java RT-RMI-York RMI+RTSJ A framework for distributed real-time Java. RT-RMI-UPM RMI+RTSJ Profiles for distributed real-time Java DRTJava-on-CSP CSP+Java Produce an alternative based on CSP formalisms RTJ-COM RTSJ A component framework for embedded Java Scratchpad RTSJ A no-heap component model for real-time Java A distributed real-time object-oriented platform APICOM RTSJ +CAN • There is not a simple technique to remove the GC’s from the server side !!! • RTZen hybrid approach, • DRTSJ , RTRMI-York, RTRMI-UPM take non-heap as a requirement JRT-11 4
  • 5. RTSJ region-based memory model • Three types of memory areas :O1=new Object – Heap – Immortal Memory (I) – Scoped Memory (Sx) O1 • A selector mechanism Sa 1 – One scope stack per thread – Enter, executeInArea Sb O2 1 • Destruction mechanism I – Stack discipline (counter) • Safety mechanism Scope Stack – Assignment rule – Single parent rule Forbidden assignment Default allocation 5 context
  • 6. Calculator() Calculator() NhRo: memory model lastInteger lastInteger add() add() lastResult() lastResult() doNothing() doNothing() • Fragmented memory model – Creation Context • Represents the state of the remote object – Invocation Context • Objects created during remote invocation • Safe nesting of contexts – NhRo-rule: references from creation to invocation are forbidden – References from invocation to creation are allowed 6
  • 7. NhRo: Example JRT-11 7
  • 8. NhRo: Impact on the middleware Scoped or Immortal CalculatorImpl_Stub CalculatorImpl lastInteger add() add() lastResult() lastResult() doNothing() doNothing() Programmer Layer ObjId Ref CC Invocation max Invocation 1 CalcID Immortal memory 0 0 Remote Object Table Thread Memory Area Pool Pool Middleware Layer JRMP/IIOP Transport Transport RTSJ Virtual Machine Client Server 8
  • 9. NhRo in action Calculator() Creation Context lastInteger (Immortal Memory) add() lastResult() Invoc. Context doNothing() (LTMemory) CalcID Ref OBJId Table enter 0 0 1 0 Thread Memory Area objID a b pool pool meth tmp ser 1 Transport CalcID.add(DataInt(3),DataInt(4)) Middleware Program DataInt(7) created created object object 9
  • 10. NhRo vs. traditional GC’d remote objects Garbage collector RTSJ-RI Memory area pool Garbage collector RTSJ-RI Memory area pool 8 16 7 14 6 Consummed time (ms) 12 Consummed time (ms) 5 10 4 8 3 6 2 4 1 2 0 0 1 21 41 61 81 101 121 141 752 1286 1910 2534 3158 sample Alive memory (kB) JRT-11 10
  • 11. Enhancements to the basic NhRo model • Patterns for programming with NhRos • NhRo stored in scoped memory – Scope stack characterization – Changes in the middleware – Policies for the memory are pool • Performance issues – Dependency on data transmitted JRT-11 11
  • 12. Calculator() NhRo: constraints (I) lastInteger add() lastResult() doNothing() • NhRo-rule limitations – Objects is creation context are destroyed after remote invocation by default • Two patterns to avoid the problem – Copy pattern – Extended portals 12
  • 13. NhRo: Scope Stack at the server Invocation context :RO1=new RemoteObject Sinv1 a b Handler 1 Thread Sa RO1 Sa RO1 Creation context Creation context 1 1 Sb Sb 1 1 I I Scope Stack Scope Stack (during remote object creation) (during remote invocation) • Creation context: state of the remote object • Invocation context: parameters of remote invocation 13
  • 15. Invocationnumber Memory Area Pool Invocationsize 0 0 0 Memory Area • It stores LTMemory instances only Pool • It requires two configuration parameters – Number of instances in the pool – Memory associated to each invocation context • Auto-collection – Invocation context returns automatically to its pool when they are not used • Internal counter 1→0 • Avoids memory area leakage 15
  • 16. bytes 5000 0 10000 15000 20000 25000 30000 void boolean byte char short int long float double null Byte Short Integer Long Float Double Character X Boolean RtUnRemOb String() JRT-11 String(10) and LTMemory size String(25) String(50) String(100) Object[0] Object[10D] Object[25D] Object[50D] Object[100D] Vector(0) Vector(10D) Vector(25D) Vector(50D) Vector(100D) Remove invocation parameters X echo(X) X doNothing() void doNothing(X) 16
  • 17. NhRos vs. (RT*) Garbage Collectors [new] JRT-11 17
  • 18. Conclusions • This work has introduced a model able to remove the garbage collection from the end-to-end path – NhRo model • Empirical results showed: – Its implementation in basic environments is simple – The performance patterns offered are powerful JRT-11 18
  • 19. Ongoing Work- • To produce an analytic model for the NhRo – Use of heap, and different threads – Identification of useful combinations • Analyze the parentage-rules proposed by Higuera- Toledano and integrate them with NhRos – A more restricted model JRT-11 19
  • 20. JRT-11 20

Editor's Notes

  • #7: From the programmer perspective, the memory model of the region based remote objects, the memory is fragmented is fragmented in two contexts. The first of this contexts is the creation context The creation context contains all objects that are accessible from the remote object instance; that is, all objects that are accessible from the state of the attibutes. The second of the contexts is the invocation context. The invocation context contains all objects that are created as consequence of the remote invocation. All objects created in the remote methods of the object belongs to the invocation context. Besides there is a safety rule. This rule is kown as NhRo-rule. It states that the objects created during the remote invocation may not be references from those that belonging the creaation context. The opposite is posible, an object stored in creation context may be referenced from the creation context.